using System;
using System.Collections;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Drawing.Text;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Web;
using PickGold.Charting.Borders3D;
using PickGold.Charting.Utilities;

namespace PickGold.Charting
{
	[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
	public class ChartGraphics : ChartElement
	{
		private RenderingType _activeRenderingType;
		private AntiAliasingStyles _antiAliasing = AntiAliasingStyles.All;
		private CommonElements _common;
		private GdiGraphics _gdiGraphics = new GdiGraphics();
		private int _height;
		private Matrix _myMatrix;
		private int _oppLeftBottomPoint = -1;
		private int _oppRigthTopPoint = -1;
		private System.Drawing.Pen _pen;
		private SolidBrush _solidBrush;
		private int _width;
		internal System.Drawing.Pen frontLinePen;
		internal PointF frontLinePoint1 = PointF.Empty;
		internal PointF frontLinePoint2 = PointF.Empty;
		internal bool IsMetafile;
		internal bool softShadows = true;

		internal ChartGraphics(CommonElements common)
		{
			this._common = common;
			base.Common = common;
			this._pen = new System.Drawing.Pen(Color.Black);
			this._solidBrush = new SolidBrush(Color.Black);
		}

		internal void AddEllipseSegment(GraphicsPath resultPath, GraphicsPath ellipseFlattenPath, GraphicsPath oppositeEllipseFlattenPath, bool veticalOrientation, float cylinderAngle, out PointF leftSideLinePoint, out PointF rightSideLinePoint)
		{
			leftSideLinePoint = PointF.Empty;
			rightSideLinePoint = PointF.Empty;
			if (ellipseFlattenPath.PointCount != 0)
			{
				int index = 0;
				int num2 = 0;
				PointF[] pathPoints = ellipseFlattenPath.PathPoints;
				if (veticalOrientation)
				{
					for (int i = 1; i < pathPoints.Length; i++)
					{
						if (pathPoints[index].X > pathPoints[i].X)
						{
							index = i;
						}
						if (pathPoints[num2].X < pathPoints[i].X)
						{
							num2 = i;
						}
					}
				}
				else
				{
					bool flag = false;
					index = -1;
					num2 = -1;
					if ((this._oppLeftBottomPoint != -1) && (this._oppRigthTopPoint != -1))
					{
						index = this._oppLeftBottomPoint;
						num2 = this._oppRigthTopPoint;
					}
					else
					{
						PointF[] tfArray2 = oppositeEllipseFlattenPath.PathPoints;
						for (int j = 0; !flag && (j < pathPoints.Length); j++)
						{
							for (int k = 0; !flag && (k < tfArray2.Length); k++)
							{
								bool flag2 = false;
								bool flag3 = false;
								bool flag4 = false;
								if ((cylinderAngle > -30f) && (cylinderAngle < 30f))
								{
									flag2 = true;
								}
								if (!flag2)
								{
									goto Label_0256;
								}
								if (tfArray2[k].Y == pathPoints[j].Y)
								{
									goto Label_0439;
								}
								float num6 = tfArray2[k].X - pathPoints[j].X;
								num6 /= tfArray2[k].Y - pathPoints[j].Y;
								for (int m = 0; m < pathPoints.Length; m++)
								{
									if (m != j)
									{
										float num8 = num6;
										num8 *= pathPoints[m].Y - pathPoints[j].Y;
										num8 += pathPoints[j].X;
										if (num8 > pathPoints[m].X)
										{
											flag3 = true;
										}
										if (num8 < pathPoints[m].X)
										{
											flag4 = true;
										}
										if (flag3 && flag4)
										{
											goto Label_01C1;
										}
									}
								}
							Label_01C1:
								if (!flag3 || !flag4)
								{
									for (int num9 = 0; num9 < tfArray2.Length; num9++)
									{
										if (num9 != k)
										{
											float num10 = num6;
											num10 *= tfArray2[num9].Y - pathPoints[j].Y;
											num10 += pathPoints[j].X;
											if (num10 > tfArray2[num9].X)
											{
												flag3 = true;
											}
											if (num10 < tfArray2[num9].X)
											{
												flag4 = true;
											}
											if (flag3 && flag4)
											{
												goto Label_03C0;
											}
										}
									}
								}
								goto Label_03C0;
							Label_0256:
								if (tfArray2[k].X == pathPoints[j].X)
								{
									goto Label_0439;
								}
								float num11 = tfArray2[k].Y - pathPoints[j].Y;
								num11 /= tfArray2[k].X - pathPoints[j].X;
								for (int n = 0; n < pathPoints.Length; n++)
								{
									if (n != j)
									{
										float num13 = num11;
										num13 *= pathPoints[n].X - pathPoints[j].X;
										num13 += pathPoints[j].Y;
										if (num13 > pathPoints[n].Y)
										{
											flag3 = true;
										}
										if (num13 < pathPoints[n].Y)
										{
											flag4 = true;
										}
										if (flag3 && flag4)
										{
											goto Label_0333;
										}
									}
								}
							Label_0333:
								if (!flag3 || !flag4)
								{
									for (int num14 = 0; num14 < tfArray2.Length; num14++)
									{
										if (num14 != k)
										{
											float num15 = num11;
											num15 *= tfArray2[num14].X - pathPoints[j].X;
											num15 += pathPoints[j].Y;
											if (num15 > tfArray2[num14].Y)
											{
												flag3 = true;
											}
											if (num15 < tfArray2[num14].Y)
											{
												flag4 = true;
											}
											if (flag3 && flag4)
											{
												goto Label_03C0;
											}
										}
									}
								}
							Label_03C0:
								if (!flag3 && (index == -1))
								{
									index = j;
									this._oppLeftBottomPoint = k;
								}
								if (!flag4 && (num2 == -1))
								{
									num2 = j;
									this._oppRigthTopPoint = k;
								}
								if ((index >= 0) && (num2 >= 0))
								{
									flag = true;
									if (flag2 && (pathPoints[index].Y > tfArray2[this._oppLeftBottomPoint].Y))
									{
										int num16 = index;
										index = num2;
										num2 = num16;
										num16 = this._oppLeftBottomPoint;
										this._oppLeftBottomPoint = this._oppRigthTopPoint;
										this._oppRigthTopPoint = num16;
									}
								}
							Label_0439: ;
							}
						}
					}
				}
				if (((index != num2) && (num2 != -1)) && (index != -1))
				{
					leftSideLinePoint = pathPoints[index];
					rightSideLinePoint = pathPoints[num2];
					for (int num17 = index + 1; num17 != (num2 + 1); num17++)
					{
						if (num17 > (pathPoints.Length - 1))
						{
							resultPath.AddLine(pathPoints[pathPoints.Length - 1], pathPoints[0]);
							num17 = 0;
						}
						else
						{
							resultPath.AddLine(pathPoints[num17 - 1], pathPoints[num17]);
						}
					}
				}
			}
		}

		private float AngleCorrection(float angle, double correction)
		{
			if ((angle > -90f) && (angle < 90f))
			{
				angle = (float)((Math.Atan(Math.Tan((angle * 3.1415926535897931) / 180.0) * correction) * 180.0) / 3.1415926535897931);
				return angle;
			}
			if ((angle > -270f) && (angle < -90f))
			{
				angle += 180f;
				angle = (float)((Math.Atan(Math.Tan((angle * 3.1415926535897931) / 180.0) * correction) * 180.0) / 3.1415926535897931);
				angle -= 180f;
				return angle;
			}
			if ((angle > 90f) && (angle < 270f))
			{
				angle -= 180f;
				angle = (float)((Math.Atan(Math.Tan((angle * 3.1415926535897931) / 180.0) * correction) * 180.0) / 3.1415926535897931);
				angle += 180f;
				return angle;
			}
			if ((angle > 270f) && (angle < 450f))
			{
				angle -= 360f;
				angle = (float)((Math.Atan(Math.Tan((angle * 3.1415926535897931) / 180.0) * correction) * 180.0) / 3.1415926535897931);
				angle += 360f;
				return angle;
			}
			if (angle > 450f)
			{
				angle -= 540f;
				angle = (float)((Math.Atan(Math.Tan((angle * 3.1415926535897931) / 180.0) * correction) * 180.0) / 3.1415926535897931);
				angle += 540f;
			}
			return angle;
		}

		internal Brush CreateBrush(RectangleF rect, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageWrapMode, Color backImageTransparentColor, GradientStyle backGradientStyle, Color backSecondaryColor)
		{
			Brush brush = new SolidBrush(backColor);
			if (((backImage.Length > 0) && (backImageWrapMode != ChartImageWrapMode.Unscaled)) && (backImageWrapMode != ChartImageWrapMode.Scaled))
			{
				return this.GetTextureBrush(backImage, backImageTransparentColor, backImageWrapMode, backColor);
			}
			if (backHatchStyle != ChartHatchStyle.None)
			{
				return this.GetHatchBrush(backHatchStyle, backColor, backSecondaryColor);
			}
			if (backGradientStyle != GradientStyle.None)
			{
				brush = this.GetGradientBrush(rect, backColor, backSecondaryColor, backGradientStyle);
			}
			return brush;
		}

		internal GraphicsPath CreateRoundedRectPath(RectangleF rect, float[] cornerRadius)
		{
			GraphicsPath path = new GraphicsPath();
			path.AddLine(rect.X + cornerRadius[0], rect.Y, rect.Right - cornerRadius[1], rect.Y);
			path.AddArc(rect.Right - (2f * cornerRadius[1]), rect.Y, 2f * cornerRadius[1], 2f * cornerRadius[2], 270f, 90f);
			path.AddLine(rect.Right, rect.Y + cornerRadius[2], rect.Right, rect.Bottom - cornerRadius[3]);
			path.AddArc((float)(rect.Right - (2f * cornerRadius[4])), (float)(rect.Bottom - (2f * cornerRadius[3])), (float)(2f * cornerRadius[4]), (float)(2f * cornerRadius[3]), 0f, 90f);
			path.AddLine(rect.Right - cornerRadius[4], rect.Bottom, rect.X + cornerRadius[5], rect.Bottom);
			path.AddArc(rect.X, rect.Bottom - (2f * cornerRadius[6]), 2f * cornerRadius[5], 2f * cornerRadius[6], 90f, 90f);
			path.AddLine(rect.X, rect.Bottom - cornerRadius[6], rect.X, rect.Y + cornerRadius[7]);
			path.AddArc(rect.X, rect.Y, 2f * cornerRadius[0], 2f * cornerRadius[7], 180f, 90f);
			return path;
		}

		internal PointF[] CreateStarPolygon(RectangleF rect, int numberOfCorners)
		{
			int num = numberOfCorners * 2;
			bool flag = true;
			PointF[] tfArray = new PointF[num];
			PointF[] pts = new PointF[1];
			for (int i = 0; i < num; i++)
			{
				pts[0] = new PointF(rect.X + (rect.Width / 2f), flag ? rect.Y : (rect.Y + (rect.Height / 4f)));
				Matrix matrix = new Matrix();
				matrix.RotateAt(i * (360f / (numberOfCorners * 2f)), new PointF(rect.X + (rect.Width / 2f), rect.Y + (rect.Height / 2f)));
				matrix.TransformPoints(pts);
				tfArray[i] = pts[0];
				flag = !flag;
			}
			return tfArray;
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				if (this._pen != null)
				{
					this._pen.Dispose();
					this._pen = null;
				}
				if (this._solidBrush != null)
				{
					this._solidBrush.Dispose();
					this._solidBrush = null;
				}
				if (this._myMatrix != null)
				{
					this._myMatrix.Dispose();
					this._myMatrix = null;
				}
			}
			base.Dispose(disposing);
		}

		internal void Draw3DBorderAbs(BorderSkin borderSkin, RectangleF absRect, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageWrapMode, Color backImageTransparentColor, ChartImageAlignmentStyle backImageAlign, GradientStyle backGradientStyle, Color backSecondaryColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle)
		{
			if (((this._common != null) && (borderSkin.SkinStyle != BorderSkinStyle.None)) && ((absRect.Width != 0f) && (absRect.Height != 0f)))
			{
				IBorderType borderType = this._common.BorderTypeRegistry.GetBorderType(borderSkin.SkinStyle.ToString());
				if (borderType != null)
				{
					borderType.Resolution = this.Graphics.DpiX;
					borderType.DrawBorder(this, borderSkin, absRect, backColor, backHatchStyle, backImage, backImageWrapMode, backImageTransparentColor, backImageAlign, backGradientStyle, backSecondaryColor, borderColor, borderWidth, borderDashStyle);
				}
			}
		}

		internal void Draw3DBorderRel(BorderSkin borderSkin, RectangleF rect, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageWrapMode, Color backImageTransparentColor, ChartImageAlignmentStyle backImageAlign, GradientStyle backGradientStyle, Color backSecondaryColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle)
		{
			this.Draw3DBorderAbs(borderSkin, this.GetAbsoluteRectangle(rect), backColor, backHatchStyle, backImage, backImageWrapMode, backImageTransparentColor, backImageAlign, backGradientStyle, backSecondaryColor, borderColor, borderWidth, borderDashStyle);
		}

		internal void Draw3DGridLine(ChartArea area, Color color, int width, ChartDashStyle style, PointF point1, PointF point2, bool horizontal, CommonElements common, object obj)
		{
			float z = area.IsMainSceneWallOnFront() ? area.areaSceneDepth : 0f;
			ChartElementType type = (obj is StripLine) ? ChartElementType.StripLines : ChartElementType.Gridlines;
			this.Draw3DLine(area.matrix3D, color, width, style, new Point3D(point1.X, point1.Y, z), new Point3D(point2.X, point2.Y, z), common, obj, type);
			if (horizontal)
			{
				if (area.IsSideSceneWallOnLeft())
				{
					point1.X = Math.Min(point1.X, point2.X);
				}
				else
				{
					point1.X = Math.Max(point1.X, point2.X);
				}
				this.Draw3DLine(area.matrix3D, color, width, style, new Point3D(point1.X, point1.Y, 0f), new Point3D(point1.X, point1.Y, area.areaSceneDepth), common, obj, type);
			}
			else if (area.IsBottomSceneWallVisible())
			{
				point1.Y = Math.Max(point1.Y, point2.Y);
				this.Draw3DLine(area.matrix3D, color, width, style, new Point3D(point1.X, point1.Y, 0f), new Point3D(point1.X, point1.Y, area.areaSceneDepth), common, obj, type);
			}
		}

		internal void Draw3DLine(Matrix3D matrix, Color color, int width, ChartDashStyle style, Point3D firstPoint, Point3D secondPoint, CommonElements common, object obj, ChartElementType type)
		{
			Point3D[] points = new Point3D[] { firstPoint, secondPoint };
			matrix.TransformPoints(points);
			if (common.ProcessModeRegions && (type != ChartElementType.Nothing))
			{
				using (GraphicsPath path = new GraphicsPath())
				{
					if (Math.Abs((float)(points[0].X - points[1].X)) > Math.Abs((float)(points[0].Y - points[1].Y)))
					{
						path.AddLine(points[0].X, points[0].Y - 1f, points[1].X, points[1].Y - 1f);
						path.AddLine(points[1].X, points[1].Y + 1f, points[0].X, points[0].Y + 1f);
						path.CloseAllFigures();
					}
					else
					{
						path.AddLine(points[0].X - 1f, points[0].Y, points[1].X - 1f, points[1].Y);
						path.AddLine(points[1].X + 1f, points[1].Y, points[0].X + 1f, points[0].Y);
						path.CloseAllFigures();
					}
					common.HotRegionsList.AddHotRegion(path, true, type, obj);
				}
			}
			if (common.ProcessModePaint)
			{
				this.DrawLineRel(color, width, style, points[0].PointF, points[1].PointF);
			}
		}

		internal GraphicsPath Draw3DPolygon(ChartArea area, Matrix3D matrix, SurfaceNames surfaceName, float positionZ, Color backColor, Color borderColor, int borderWidth, DataPoint3D firstPoint, DataPoint3D secondPoint, DataPoint3D thirdPoint, DataPoint3D fourthPoint, DrawingOperationTypes operationType, LineSegmentType lineSegmentType, SurfaceNames thinBorders)
		{
			bool flag = (operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement;
			GraphicsPath path = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath) ? new GraphicsPath() : null;
			Point3D[] points = new Point3D[] { new Point3D((float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ), new Point3D((float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ), new Point3D((float)thirdPoint.xPosition, (float)thirdPoint.yPosition, positionZ), new Point3D((float)fourthPoint.xPosition, (float)fourthPoint.yPosition, positionZ) };
			matrix.TransformPoints(points);
			PointF[] tfArray = new PointF[] { this.GetAbsolutePoint(points[0].PointF), this.GetAbsolutePoint(points[1].PointF), this.GetAbsolutePoint(points[2].PointF), this.GetAbsolutePoint(points[3].PointF) };
			bool visiblePolygon = IsSurfaceVisible(points[0], points[1], points[2]);
			Color color = matrix.GetPolygonLight(points, backColor, visiblePolygon, (float)area.Area3DStyle.Rotation, surfaceName, area.ReverseSeriesOrder);
			Color color2 = borderColor;
			if (color2 == Color.Empty)
			{
				color2 = GetGradientColor(backColor, Color.Black, 0.2);
			}
			System.Drawing.Pen pen = null;
			if (flag)
			{
				System.Drawing.Drawing2D.SmoothingMode smoothingMode = this.SmoothingMode;
				this.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
				using (Brush brush = new SolidBrush(color))
				{
					this.FillPolygon(brush, tfArray);
				}
				this.SmoothingMode = smoothingMode;
				if (thinBorders != 0)
				{
					System.Drawing.Pen pen2 = new System.Drawing.Pen(color2, 1f);
					if ((thinBorders & SurfaceNames.Left) != 0)
					{
						this.DrawLine(pen2, tfArray[3], tfArray[0]);
					}
					if ((thinBorders & SurfaceNames.Right) != 0)
					{
						this.DrawLine(pen2, tfArray[1], tfArray[2]);
					}
					if ((thinBorders & SurfaceNames.Top) != 0)
					{
						this.DrawLine(pen2, tfArray[0], tfArray[1]);
					}
					if ((thinBorders & SurfaceNames.Bottom) != 0)
					{
						this.DrawLine(pen2, tfArray[2], tfArray[3]);
					}
				}
				else if (color.A == 0xff)
				{
					this.DrawPolygon(new System.Drawing.Pen(color, 1f), tfArray);
				}
				pen = new System.Drawing.Pen(color2, (float)borderWidth);
				pen.StartCap = LineCap.Round;
				pen.EndCap = LineCap.Round;
				this.DrawLine(pen, tfArray[0], tfArray[1]);
				this.DrawLine(pen, tfArray[2], tfArray[3]);
				if (lineSegmentType == LineSegmentType.First)
				{
					this.DrawLine(pen, tfArray[3], tfArray[0]);
				}
				else if (lineSegmentType == LineSegmentType.Last)
				{
					this.DrawLine(pen, tfArray[1], tfArray[2]);
				}
			}
			if (area.Area3DStyle.Perspective == 0)
			{
				if ((this.frontLinePoint1 != PointF.Empty) && (this.frontLinePen != null))
				{
					if (((((this.frontLinePoint1.X != tfArray[0].X) || (this.frontLinePoint1.Y != tfArray[0].Y)) && ((this.frontLinePoint2.X != tfArray[1].X) || (this.frontLinePoint2.Y != tfArray[1].Y))) && (((this.frontLinePoint1.X != tfArray[1].X) || (this.frontLinePoint1.Y != tfArray[1].Y)) && ((this.frontLinePoint2.X != tfArray[0].X) || (this.frontLinePoint2.Y != tfArray[0].Y)))) && ((((this.frontLinePoint1.X != tfArray[3].X) || (this.frontLinePoint1.Y != tfArray[3].Y)) && ((this.frontLinePoint2.X != tfArray[2].X) || (this.frontLinePoint2.Y != tfArray[2].Y))) && (((this.frontLinePoint1.X != tfArray[2].X) || (this.frontLinePoint1.Y != tfArray[2].Y)) && ((this.frontLinePoint2.X != tfArray[3].X) || (this.frontLinePoint2.Y != tfArray[3].Y)))))
					{
						this.DrawLine(this.frontLinePen, (float)Math.Round((double)this.frontLinePoint1.X), (float)Math.Round((double)this.frontLinePoint1.Y), (float)Math.Round((double)this.frontLinePoint2.X), (float)Math.Round((double)this.frontLinePoint2.Y));
					}
					this.frontLinePen = null;
					this.frontLinePoint1 = PointF.Empty;
					this.frontLinePoint2 = PointF.Empty;
				}
				if (flag)
				{
					this.frontLinePen = pen;
					this.frontLinePoint1 = tfArray[0];
					this.frontLinePoint2 = tfArray[1];
				}
			}
			if (path != null)
			{
				path.AddPolygon(tfArray);
			}
			return path;
		}

		internal GraphicsPath Draw3DSplineSurface(ChartArea area, Matrix3D matrix, LightStyle lightStyle, SurfaceNames surfaceName, float positionZ, float depth, Color backColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, DataPoint3D firstPoint, DataPoint3D secondPoint, ArrayList points, int pointIndex, float tension, DrawingOperationTypes operationType, bool forceThinBorder, bool forceThickBorder, bool reversedSeriesOrder, bool multiSeries, int yValueIndex, bool clipInsideArea)
		{
			if (tension == 0f)
			{
				return this.Draw3DSurface(area, matrix, lightStyle, surfaceName, positionZ, depth, backColor, borderColor, borderWidth, borderDashStyle, firstPoint, secondPoint, points, pointIndex, tension, operationType, LineSegmentType.Single, forceThinBorder, forceThickBorder, reversedSeriesOrder, multiSeries, yValueIndex, clipInsideArea);
			}
			GraphicsPath path = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath) ? new GraphicsPath() : null;
			GraphicsPath path2 = this.GetSplineFlattenPath(area, positionZ, firstPoint, secondPoint, points, tension, true, false, yValueIndex);
			bool flag = false;
			if ((pointIndex + 1) < points.Count)
			{
				DataPoint3D pointd = (DataPoint3D)points[pointIndex + 1];
				if (pointd.index == firstPoint.index)
				{
					flag = true;
				}
			}
			if (flag)
			{
				path2.Reverse();
			}
			PointF[] pathPoints = path2.PathPoints;
			DataPoint3D pointd2 = new DataPoint3D();
			DataPoint3D pointd3 = new DataPoint3D();
			LineSegmentType middle = LineSegmentType.Middle;
			for (int i = 1; i < pathPoints.Length; i++)
			{
				bool flag2 = false;
				bool flag3 = false;
				if (!flag)
				{
					pointd2.index = firstPoint.index;
					pointd2.dataPoint = firstPoint.dataPoint;
					pointd2.xPosition = pathPoints[i - 1].X;
					pointd2.yPosition = pathPoints[i - 1].Y;
					pointd3.index = secondPoint.index;
					pointd3.index = secondPoint.index;
					pointd3.xPosition = pathPoints[i].X;
					pointd3.yPosition = pathPoints[i].Y;
				}
				else
				{
					pointd3.index = firstPoint.index;
					pointd3.dataPoint = firstPoint.dataPoint;
					pointd3.xPosition = pathPoints[i - 1].X;
					pointd3.yPosition = pathPoints[i - 1].Y;
					pointd2.index = secondPoint.index;
					pointd2.dataPoint = secondPoint.dataPoint;
					pointd2.xPosition = pathPoints[i].X;
					pointd2.yPosition = pathPoints[i].Y;
				}
				middle = LineSegmentType.Middle;
				if (i == 1)
				{
					if (!flag)
					{
						middle = LineSegmentType.First;
					}
					else
					{
						middle = LineSegmentType.Last;
					}
					flag2 = forceThinBorder;
					flag3 = forceThickBorder;
				}
				else if (i == (pathPoints.Length - 1))
				{
					if (!flag)
					{
						middle = LineSegmentType.Last;
					}
					else
					{
						middle = LineSegmentType.First;
					}
					flag2 = forceThinBorder;
					flag3 = forceThickBorder;
				}
				GraphicsPath addingPath = this.Draw3DSurface(area, matrix, lightStyle, surfaceName, positionZ, depth, backColor, borderColor, borderWidth, borderDashStyle, pointd2, pointd3, points, pointIndex, 0f, operationType, middle, flag2, flag3, reversedSeriesOrder, multiSeries, yValueIndex, clipInsideArea);
				if (((path != null) && (addingPath != null)) && (addingPath.PointCount > 0))
				{
					path.AddPath(addingPath, true);
				}
			}
			return path;
		}

		internal GraphicsPath Draw3DSurface(ChartArea area, Matrix3D matrix, LightStyle lightStyle, SurfaceNames surfaceName, float positionZ, float depth, Color backColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, DataPoint3D firstPoint, DataPoint3D secondPoint, ArrayList points, int pointIndex, float tension, DrawingOperationTypes operationType, LineSegmentType lineSegmentType, bool forceThinBorder, bool forceThickBorder, bool reversedSeriesOrder, bool multiSeries, int yValueIndex, bool clipInsideArea)
		{
			if (tension != 0f)
			{
				return this.Draw3DSplineSurface(area, matrix, lightStyle, surfaceName, positionZ, depth, backColor, borderColor, borderWidth, borderDashStyle, firstPoint, secondPoint, points, pointIndex, tension, operationType, forceThinBorder, forceThickBorder, reversedSeriesOrder, multiSeries, yValueIndex, clipInsideArea);
			}
			bool flag = (operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement;
			GraphicsPath path = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath) ? new GraphicsPath() : null;
			if ((((decimal)firstPoint.xPosition) != ((decimal)secondPoint.xPosition)) || (((decimal)firstPoint.yPosition) != ((decimal)secondPoint.yPosition)))
			{
				if (clipInsideArea)
				{
					int decimals = 3;
					decimal num2 = Math.Round((decimal)area.PlotAreaPosition.X, decimals);
					decimal num3 = Math.Round((decimal)area.PlotAreaPosition.Y, decimals);
					decimal num4 = Math.Round((decimal)area.PlotAreaPosition.Right, decimals);
					decimal num5 = Math.Round((decimal)area.PlotAreaPosition.Bottom, decimals);
					num2 -= 0.001M;
					num3 -= 0.001M;
					num4 += 0.001M;
					num5 += 0.001M;
					if (((((decimal)firstPoint.xPosition) < num2) || (((decimal)firstPoint.xPosition) > num4)) || ((((decimal)secondPoint.xPosition) < num2) || (((decimal)secondPoint.xPosition) > num4)))
					{
						if ((((decimal)firstPoint.xPosition) < num2) && (((decimal)secondPoint.xPosition) < num2))
						{
							return path;
						}
						if ((((decimal)firstPoint.xPosition) > num4) && (((decimal)secondPoint.xPosition) > num4))
						{
							return path;
						}
						if (((decimal)firstPoint.xPosition) < num2)
						{
							firstPoint.yPosition = (((((double)num2) - secondPoint.xPosition) / (firstPoint.xPosition - secondPoint.xPosition)) * (firstPoint.yPosition - secondPoint.yPosition)) + secondPoint.yPosition;
							firstPoint.xPosition = (double)num2;
						}
						else if (((decimal)firstPoint.xPosition) > num4)
						{
							firstPoint.yPosition = (((((double)num4) - secondPoint.xPosition) / (firstPoint.xPosition - secondPoint.xPosition)) * (firstPoint.yPosition - secondPoint.yPosition)) + secondPoint.yPosition;
							firstPoint.xPosition = (double)num4;
						}
						if (((decimal)secondPoint.xPosition) < num2)
						{
							secondPoint.yPosition = (((((double)num2) - secondPoint.xPosition) / (firstPoint.xPosition - secondPoint.xPosition)) * (firstPoint.yPosition - secondPoint.yPosition)) + secondPoint.yPosition;
							secondPoint.xPosition = (double)num2;
						}
						else if (((decimal)secondPoint.xPosition) > num4)
						{
							secondPoint.yPosition = (((((double)num4) - secondPoint.xPosition) / (firstPoint.xPosition - secondPoint.xPosition)) * (firstPoint.yPosition - secondPoint.yPosition)) + secondPoint.yPosition;
							secondPoint.xPosition = (double)num4;
						}
					}
					if (((((decimal)firstPoint.yPosition) < num3) || (((decimal)firstPoint.yPosition) > num5)) || ((((decimal)secondPoint.yPosition) < num3) || (((decimal)secondPoint.yPosition) > num5)))
					{
						double yPosition = firstPoint.yPosition;
						double num7 = secondPoint.yPosition;
						bool flag2 = false;
						if ((((decimal)firstPoint.yPosition) < num3) && (((decimal)secondPoint.yPosition) < num3))
						{
							flag2 = true;
							firstPoint.yPosition = (double)num3;
							secondPoint.yPosition = (double)num3;
						}
						if ((((decimal)firstPoint.yPosition) > num5) && (((decimal)secondPoint.yPosition) > num5))
						{
							flag2 = true;
							firstPoint.yPosition = (double)num5;
							secondPoint.yPosition = (double)num5;
						}
						Color color = GetGradientColor(backColor, Color.Black, 0.5);
						Color color2 = GetGradientColor(borderColor, Color.Black, 0.5);
						if (flag2)
						{
							path = this.Draw3DSurface(area, matrix, lightStyle, surfaceName, positionZ, depth, color, color2, borderWidth, borderDashStyle, firstPoint, secondPoint, points, pointIndex, tension, operationType, lineSegmentType, forceThinBorder, forceThickBorder, reversedSeriesOrder, multiSeries, yValueIndex, clipInsideArea);
							firstPoint.yPosition = yPosition;
							secondPoint.yPosition = num7;
							return path;
						}
						DataPoint3D pointd = new DataPoint3D();
						pointd.yPosition = (double)num3;
						if ((((decimal)firstPoint.yPosition) > num5) || (((decimal)secondPoint.yPosition) > num5))
						{
							pointd.yPosition = (double)num5;
						}
						pointd.xPosition = (((pointd.yPosition - secondPoint.yPosition) * (firstPoint.xPosition - secondPoint.xPosition)) / (firstPoint.yPosition - secondPoint.yPosition)) + secondPoint.xPosition;
						int num8 = 2;
						DataPoint3D pointd2 = null;
						if (((((decimal)firstPoint.yPosition) < num3) && (((decimal)secondPoint.yPosition) > num5)) || ((((decimal)firstPoint.yPosition) > num5) && (((decimal)secondPoint.yPosition) < num3)))
						{
							num8 = 3;
							pointd2 = new DataPoint3D();
							if (((decimal)pointd.yPosition) == num3)
							{
								pointd2.yPosition = (double)num5;
							}
							else
							{
								pointd2.yPosition = (double)num3;
							}
							pointd2.xPosition = (((pointd2.yPosition - secondPoint.yPosition) * (firstPoint.xPosition - secondPoint.xPosition)) / (firstPoint.yPosition - secondPoint.yPosition)) + secondPoint.xPosition;
							if (((decimal)firstPoint.yPosition) > num5)
							{
								DataPoint3D pointd3 = new DataPoint3D();
								pointd3.xPosition = pointd.xPosition;
								pointd3.yPosition = pointd.yPosition;
								pointd.xPosition = pointd2.xPosition;
								pointd.yPosition = pointd2.yPosition;
								pointd2.xPosition = pointd3.xPosition;
								pointd2.yPosition = pointd3.yPosition;
							}
						}
						bool flag3 = true;
						if (((decimal)firstPoint.yPosition) < num3)
						{
							flag3 = false;
							firstPoint.yPosition = (double)num3;
						}
						else if (((decimal)firstPoint.yPosition) > num5)
						{
							flag3 = false;
							firstPoint.yPosition = (double)num5;
						}
						if (((decimal)secondPoint.yPosition) < num3)
						{
							secondPoint.yPosition = (double)num3;
						}
						else if (((decimal)secondPoint.yPosition) > num5)
						{
							secondPoint.yPosition = (double)num5;
						}
						bool flag4 = false;
						if ((pointIndex + 1) < points.Count)
						{
							DataPoint3D pointd4 = (DataPoint3D)points[pointIndex + 1];
							if (pointd4.index == firstPoint.index)
							{
								flag4 = true;
							}
						}
						for (int i = 0; i < 3; i++)
						{
							GraphicsPath addingPath = null;
							if (((i == 0) && !flag4) || ((i == 2) && flag4))
							{
								if (pointd2 == null)
								{
									pointd2 = pointd;
								}
								pointd2.dataPoint = secondPoint.dataPoint;
								pointd2.index = secondPoint.index;
								addingPath = this.Draw3DSurface(area, matrix, lightStyle, surfaceName, positionZ, depth, (flag3 && (num8 != 3)) ? backColor : color, (flag3 && (num8 != 3)) ? borderColor : color2, borderWidth, borderDashStyle, firstPoint, pointd2, points, pointIndex, tension, operationType, lineSegmentType, forceThinBorder, forceThickBorder, reversedSeriesOrder, multiSeries, yValueIndex, clipInsideArea);
							}
							if (((i == 1) && (pointd2 != null)) && (num8 == 3))
							{
								pointd2.dataPoint = secondPoint.dataPoint;
								pointd2.index = secondPoint.index;
								addingPath = this.Draw3DSurface(area, matrix, lightStyle, surfaceName, positionZ, depth, backColor, borderColor, borderWidth, borderDashStyle, pointd, pointd2, points, pointIndex, tension, operationType, lineSegmentType, forceThinBorder, forceThickBorder, reversedSeriesOrder, multiSeries, yValueIndex, clipInsideArea);
							}
							if (((i == 2) && !flag4) || ((i == 0) && flag4))
							{
								pointd.dataPoint = firstPoint.dataPoint;
								pointd.index = firstPoint.index;
								addingPath = this.Draw3DSurface(area, matrix, lightStyle, surfaceName, positionZ, depth, (!flag3 && (num8 != 3)) ? backColor : color, (!flag3 && (num8 != 3)) ? borderColor : color2, borderWidth, borderDashStyle, pointd, secondPoint, points, pointIndex, tension, operationType, lineSegmentType, forceThinBorder, forceThickBorder, reversedSeriesOrder, multiSeries, yValueIndex, clipInsideArea);
							}
							if (((path != null) && (addingPath != null)) && (addingPath.PointCount > 0))
							{
								path.SetMarkers();
								path.AddPath(addingPath, true);
							}
						}
						firstPoint.yPosition = yPosition;
						secondPoint.yPosition = num7;
						return path;
					}
				}
				Point3D[] pointdArray = new Point3D[] { new Point3D((float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ + depth), new Point3D((float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ + depth), new Point3D((float)secondPoint.xPosition, (float)secondPoint.yPosition, positionZ), new Point3D((float)firstPoint.xPosition, (float)firstPoint.yPosition, positionZ) };
				matrix.TransformPoints(pointdArray);
				PointF[] tfArray = new PointF[] { this.GetAbsolutePoint(pointdArray[0].PointF), this.GetAbsolutePoint(pointdArray[1].PointF), this.GetAbsolutePoint(pointdArray[2].PointF), this.GetAbsolutePoint(pointdArray[3].PointF) };
				bool visiblePolygon = IsSurfaceVisible(pointdArray[0], pointdArray[1], pointdArray[2]);
				Color color3 = matrix.GetPolygonLight(pointdArray, backColor, visiblePolygon, (float)area.Area3DStyle.Rotation, surfaceName, area.ReverseSeriesOrder);
				Color color4 = borderColor;
				if (color4 == Color.Empty)
				{
					color4 = GetGradientColor(backColor, Color.Black, 0.2);
				}
				System.Drawing.Pen pen = new System.Drawing.Pen(color4, 1f);
				if (flag)
				{
					if (backColor != Color.Transparent)
					{
						System.Drawing.Drawing2D.SmoothingMode smoothingMode = this.SmoothingMode;
						this.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
						using (Brush brush = new SolidBrush(color3))
						{
							this.FillPolygon(brush, tfArray);
						}
						this.SmoothingMode = smoothingMode;
					}
					if (forceThinBorder || forceThickBorder)
					{
						if (forceThickBorder)
						{
							System.Drawing.Pen pen2 = new System.Drawing.Pen(color4, (float)borderWidth);
							pen2.StartCap = LineCap.Round;
							pen2.EndCap = LineCap.Round;
							this.DrawLine(pen2, tfArray[0], tfArray[1]);
							this.DrawLine(pen2, tfArray[2], tfArray[3]);
							this.DrawLine(pen2, tfArray[3], tfArray[0]);
							this.DrawLine(pen2, tfArray[1], tfArray[2]);
						}
						else
						{
							this.DrawLine(pen, tfArray[0], tfArray[1]);
							this.DrawLine(pen, tfArray[2], tfArray[3]);
							if (lineSegmentType == LineSegmentType.First)
							{
								this.DrawLine(pen, tfArray[3], tfArray[0]);
							}
							else if (lineSegmentType == LineSegmentType.Last)
							{
								this.DrawLine(pen, tfArray[1], tfArray[2]);
							}
							else
							{
								this.DrawLine(pen, tfArray[3], tfArray[0]);
								this.DrawLine(pen, tfArray[1], tfArray[2]);
							}
						}
					}
					else
					{
						if (color3.A == 0xff)
						{
							this.DrawPolygon(new System.Drawing.Pen(color3, 1f), tfArray);
						}
						this.DrawLine(pen, tfArray[0], tfArray[1]);
						this.DrawLine(pen, tfArray[2], tfArray[3]);
					}
				}
				System.Drawing.Pen pen3 = null;
				if ((borderWidth > 1) && !forceThickBorder)
				{
					pen3 = new System.Drawing.Pen(color4, (float)borderWidth);
					pen3.StartCap = LineCap.Round;
					pen3.EndCap = LineCap.Round;
					if (firstPoint.index > secondPoint.index)
					{
						DataPoint3D pointd5 = firstPoint;
						firstPoint = secondPoint;
						secondPoint = pointd5;
					}
					float x = Math.Min(pointdArray[0].X, pointdArray[1].X);
					float y = Math.Min(pointdArray[0].Y, pointdArray[1].Y);
					float num12 = Math.Max(pointdArray[0].X, pointdArray[1].X);
					float num13 = Math.Max(pointdArray[0].Y, pointdArray[1].Y);
					RectangleF position = new RectangleF(x, y, num12 - x, num13 - y);
					SurfaceNames boundaryRectVisibleSurfaces = this.GetVisibleSurfaces(position, positionZ, depth, matrix);
					bool flag6 = false;
					bool flag7 = false;
					if (lineSegmentType != LineSegmentType.Middle)
					{
						LineSegmentType single = LineSegmentType.Single;
						flag6 = ShouldDrawLineChartSurface(area, reversedSeriesOrder, SurfaceNames.Left, boundaryRectVisibleSurfaces, color3, points, firstPoint, secondPoint, multiSeries, ref single) == 2;
						flag7 = ShouldDrawLineChartSurface(area, reversedSeriesOrder, SurfaceNames.Right, boundaryRectVisibleSurfaces, color3, points, firstPoint, secondPoint, multiSeries, ref single) == 2;
					}
					if (reversedSeriesOrder)
					{
						bool flag8 = flag6;
						flag6 = flag7;
						flag7 = flag8;
					}
					if ((lineSegmentType != LineSegmentType.First) && (lineSegmentType != LineSegmentType.Single))
					{
						flag6 = false;
					}
					if ((lineSegmentType != LineSegmentType.Last) && (lineSegmentType != LineSegmentType.Single))
					{
						flag7 = false;
					}
					if ((matrix.Perspective != 0f) || ((((matrix.AngleX != 90f) && (matrix.AngleX != -90f)) && ((matrix.AngleY != 90f) && (matrix.AngleY != -90f))) && ((matrix.AngleY != 180f) && (matrix.AngleY != -180f))))
					{
						if (flag)
						{
							this.DrawLine(pen3, (float)Math.Round((double)tfArray[0].X), (float)Math.Round((double)tfArray[0].Y), (float)Math.Round((double)tfArray[1].X), (float)Math.Round((double)tfArray[1].Y));
						}
						if (path != null)
						{
							path.AddLine((float)Math.Round((double)tfArray[0].X), (float)Math.Round((double)tfArray[0].Y), (float)Math.Round((double)tfArray[1].X), (float)Math.Round((double)tfArray[1].Y));
						}
					}
					pen3.EndCap = LineCap.Flat;
					if (((matrix.Perspective != 0f) || ((matrix.AngleX != 90f) && (matrix.AngleX != -90f))) && flag6)
					{
						if (flag)
						{
							this.DrawLine(pen3, (float)Math.Round((double)tfArray[3].X), (float)Math.Round((double)tfArray[3].Y), (float)Math.Round((double)tfArray[0].X), (float)Math.Round((double)tfArray[0].Y));
						}
						if (path != null)
						{
							path.AddLine((float)Math.Round((double)tfArray[3].X), (float)Math.Round((double)tfArray[3].Y), (float)Math.Round((double)tfArray[0].X), (float)Math.Round((double)tfArray[0].Y));
						}
					}
					if (((matrix.Perspective != 0f) || ((matrix.AngleX != 90f) && (matrix.AngleX != -90f))) && flag7)
					{
						if (flag)
						{
							this.DrawLine(pen3, (float)Math.Round((double)tfArray[1].X), (float)Math.Round((double)tfArray[1].Y), (float)Math.Round((double)tfArray[2].X), (float)Math.Round((double)tfArray[2].Y));
						}
						if (path != null)
						{
							path.AddLine((float)Math.Round((double)tfArray[1].X), (float)Math.Round((double)tfArray[1].Y), (float)Math.Round((double)tfArray[2].X), (float)Math.Round((double)tfArray[2].Y));
						}
					}
				}
				if (area.Area3DStyle.Perspective == 0)
				{
					if ((this.frontLinePoint1 != PointF.Empty) && (this.frontLinePen != null))
					{
						this.DrawLine(this.frontLinePen, (float)Math.Round((double)this.frontLinePoint1.X), (float)Math.Round((double)this.frontLinePoint1.Y), (float)Math.Round((double)this.frontLinePoint2.X), (float)Math.Round((double)this.frontLinePoint2.Y));
						this.frontLinePen = null;
						this.frontLinePoint1 = PointF.Empty;
						this.frontLinePoint2 = PointF.Empty;
					}
					if (flag)
					{
						this.frontLinePen = (borderWidth > 1) ? pen3 : pen;
						this.frontLinePoint1 = tfArray[0];
						this.frontLinePoint2 = tfArray[1];
					}
				}
				if (path != null)
				{
					if (pen3 != null)
					{
						try
						{
							path.Widen(pen3);
						}
						catch (OutOfMemoryException)
						{
						}
						catch (ArgumentException)
						{
						}
					}
					path.AddPolygon(tfArray);
				}
			}
			return path;
		}

		internal void DrawArrowRel(PointF position, ArrowOrientation orientation, AxisArrowStyle type, Color color, int lineWidth, ChartDashStyle lineDashStyle, double shift, double size)
		{
			if (type != AxisArrowStyle.None)
			{
				using (SolidBrush brush = new SolidBrush(color))
				{
					PointF[] tfArray;
					PointF empty = PointF.Empty;
					PointF absolutePoint = this.GetAbsolutePoint(position);
					if (type == AxisArrowStyle.Triangle)
					{
						tfArray = this.GetArrowShape(absolutePoint, orientation, shift, size, type, ref empty);
						empty = this.GetRelativePoint(empty);
						this.DrawLineRel(color, lineWidth, lineDashStyle, position, empty);
						this.FillPolygon(brush, tfArray);
					}
					else if (type == AxisArrowStyle.SharpTriangle)
					{
						tfArray = this.GetArrowShape(absolutePoint, orientation, shift, size, type, ref empty);
						empty = this.GetRelativePoint(empty);
						this.DrawLineRel(color, lineWidth, lineDashStyle, position, empty);
						this.FillPolygon(brush, tfArray);
					}
					else if (type == AxisArrowStyle.Lines)
					{
						tfArray = this.GetArrowShape(absolutePoint, orientation, shift, size, type, ref empty);
						tfArray[0] = this.GetRelativePoint(tfArray[0]);
						tfArray[1] = this.GetRelativePoint(tfArray[1]);
						tfArray[2] = this.GetRelativePoint(tfArray[2]);
						empty = this.GetRelativePoint(empty);
						this.DrawLineRel(color, lineWidth, lineDashStyle, position, empty);
						this.DrawLineRel(color, lineWidth, lineDashStyle, tfArray[0], tfArray[2]);
						this.DrawLineRel(color, lineWidth, lineDashStyle, tfArray[1], tfArray[2]);
					}
				}
			}
		}

		private void DrawBarStyleGradients(Matrix3D matrix, BarDrawingStyle barDrawingStyle, RectangleF position, float positionZ, float depth, bool isVertical)
		{
			if (barDrawingStyle == BarDrawingStyle.Wedge)
			{
				RectangleF absoluteRectangle = this.GetAbsoluteRectangle(position);
				float width = isVertical ? (absoluteRectangle.Width / 2f) : (absoluteRectangle.Height / 2f);
				if (isVertical && ((2f * width) > absoluteRectangle.Height))
				{
					width = absoluteRectangle.Height / 2f;
				}
				if (!isVertical && ((2f * width) > absoluteRectangle.Width))
				{
					width = absoluteRectangle.Width / 2f;
				}
				SizeF relativeSize = this.GetRelativeSize(new SizeF(width, width));
				Point3D[] points = new Point3D[6];
				points[0] = new Point3D(position.Left, position.Top, positionZ + depth);
				points[1] = new Point3D(position.Left, position.Bottom, positionZ + depth);
				points[2] = new Point3D(position.Right, position.Bottom, positionZ + depth);
				points[3] = new Point3D(position.Right, position.Top, positionZ + depth);
				if (isVertical)
				{
					points[4] = new Point3D(position.X + (position.Width / 2f), position.Top + relativeSize.Height, positionZ + depth);
					points[5] = new Point3D(position.X + (position.Width / 2f), position.Bottom - relativeSize.Height, positionZ + depth);
				}
				else
				{
					points[4] = new Point3D(position.X + relativeSize.Width, position.Top + (position.Height / 2f), positionZ + depth);
					points[5] = new Point3D(position.Right - relativeSize.Width, position.Top + (position.Height / 2f), positionZ + depth);
				}
				matrix.TransformPoints(points);
				PointF[] tfArray = new PointF[6];
				for (int i = 0; i < points.Length; i++)
				{
					tfArray[i] = this.GetAbsolutePoint(points[i].PointF);
				}
				using (GraphicsPath path = new GraphicsPath())
				{
					if (isVertical)
					{
						path.AddLine(tfArray[4], tfArray[5]);
						path.AddLine(tfArray[5], tfArray[2]);
						path.AddLine(tfArray[2], tfArray[3]);
					}
					else
					{
						path.AddLine(tfArray[4], tfArray[5]);
						path.AddLine(tfArray[5], tfArray[2]);
						path.AddLine(tfArray[2], tfArray[1]);
					}
					path.CloseAllFigures();
					using (SolidBrush brush = new SolidBrush(Color.FromArgb(90, Color.Black)))
					{
						this.FillPath(brush, path);
					}
				}
				using (GraphicsPath path2 = new GraphicsPath())
				{
					if (isVertical)
					{
						path2.AddLine(tfArray[0], tfArray[4]);
						path2.AddLine(tfArray[4], tfArray[3]);
					}
					else
					{
						path2.AddLine(tfArray[3], tfArray[5]);
						path2.AddLine(tfArray[5], tfArray[2]);
					}
					using (SolidBrush brush2 = new SolidBrush(Color.FromArgb(50, Color.Black)))
					{
						this.FillPath(brush2, path2);
						using (System.Drawing.Pen pen = new System.Drawing.Pen(Color.FromArgb(20, Color.Black), 1f))
						{
							this.DrawPath(pen, path2);
							this.DrawLine(pen, tfArray[4], tfArray[5]);
						}
						using (System.Drawing.Pen pen2 = new System.Drawing.Pen(Color.FromArgb(40, Color.White), 1f))
						{
							this.DrawPath(pen2, path2);
							this.DrawLine(pen2, tfArray[4], tfArray[5]);
						}
					}
				}
				using (GraphicsPath path3 = new GraphicsPath())
				{
					if (isVertical)
					{
						path3.AddLine(tfArray[1], tfArray[5]);
						path3.AddLine(tfArray[5], tfArray[2]);
					}
					else
					{
						path3.AddLine(tfArray[0], tfArray[4]);
						path3.AddLine(tfArray[4], tfArray[1]);
					}
					using (SolidBrush brush3 = new SolidBrush(Color.FromArgb(50, Color.Black)))
					{
						this.FillPath(brush3, path3);
						using (System.Drawing.Pen pen3 = new System.Drawing.Pen(Color.FromArgb(20, Color.Black), 1f))
						{
							this.DrawPath(pen3, path3);
						}
						using (System.Drawing.Pen pen4 = new System.Drawing.Pen(Color.FromArgb(40, Color.White), 1f))
						{
							this.DrawPath(pen4, path3);
						}
					}
					return;
				}
			}
			if (barDrawingStyle == BarDrawingStyle.LightToDark)
			{
				RectangleF ef3 = this.GetAbsoluteRectangle(position);
				float num3 = 5f;
				if ((ef3.Width < 6f) || (ef3.Height < 6f))
				{
					num3 = 2f;
				}
				else if ((ef3.Width < 15f) || (ef3.Height < 15f))
				{
					num3 = 3f;
				}
				SizeF ef4 = this.GetRelativeSize(new SizeF(num3, num3));
				RectangleF ef5 = position;
				ef5.Inflate(-ef4.Width, -ef4.Height);
				if (isVertical)
				{
					ef5.Height = (float)Math.Floor((double)(ef5.Height / 3f));
				}
				else
				{
					ef5.X = ef5.Right - ((float)Math.Floor((double)(ef5.Width / 3f)));
					ef5.Width = (float)Math.Floor((double)(ef5.Width / 3f));
				}
				Point3D[] pointdArray2 = new Point3D[] { new Point3D(ef5.Left, ef5.Top, positionZ + depth), new Point3D(ef5.Left, ef5.Bottom, positionZ + depth), new Point3D(ef5.Right, ef5.Bottom, positionZ + depth), new Point3D(ef5.Right, ef5.Top, positionZ + depth) };
				matrix.TransformPoints(pointdArray2);
				PointF[] tfArray2 = new PointF[4];
				for (int j = 0; j < pointdArray2.Length; j++)
				{
					tfArray2[j] = this.GetAbsolutePoint(pointdArray2[j].PointF);
				}
				using (GraphicsPath path4 = new GraphicsPath())
				{
					path4.AddPolygon(tfArray2);
					RectangleF bounds = path4.GetBounds();
					bounds.Width++;
					bounds.Height++;
					if ((bounds.Width > 0f) && (bounds.Height > 0f))
					{
						using (LinearGradientBrush brush4 = new LinearGradientBrush(bounds, !isVertical ? Color.Transparent : Color.FromArgb(120, Color.White), !isVertical ? Color.FromArgb(120, Color.White) : Color.Transparent, isVertical ? LinearGradientMode.Vertical : LinearGradientMode.Horizontal))
						{
							this.FillPath(brush4, path4);
						}
					}
				}
				ef5 = position;
				ef5.Inflate(-ef4.Width, -ef4.Height);
				if (isVertical)
				{
					ef5.Y = ef5.Bottom - ((float)Math.Floor((double)(ef5.Height / 3f)));
					ef5.Height = (float)Math.Floor((double)(ef5.Height / 3f));
				}
				else
				{
					ef5.Width = (float)Math.Floor((double)(ef5.Width / 3f));
				}
				pointdArray2 = new Point3D[] { new Point3D(ef5.Left, ef5.Top, positionZ + depth), new Point3D(ef5.Left, ef5.Bottom, positionZ + depth), new Point3D(ef5.Right, ef5.Bottom, positionZ + depth), new Point3D(ef5.Right, ef5.Top, positionZ + depth) };
				matrix.TransformPoints(pointdArray2);
				tfArray2 = new PointF[4];
				for (int k = 0; k < pointdArray2.Length; k++)
				{
					tfArray2[k] = this.GetAbsolutePoint(pointdArray2[k].PointF);
				}
				using (GraphicsPath path5 = new GraphicsPath())
				{
					path5.AddPolygon(tfArray2);
					RectangleF rect = path5.GetBounds();
					rect.Width++;
					rect.Height++;
					if ((rect.Width > 0f) && (rect.Height > 0f))
					{
						using (LinearGradientBrush brush5 = new LinearGradientBrush(rect, isVertical ? Color.Transparent : Color.FromArgb(80, Color.Black), isVertical ? Color.FromArgb(80, Color.Black) : Color.Transparent, isVertical ? LinearGradientMode.Vertical : LinearGradientMode.Horizontal))
						{
							this.FillPath(brush5, path5);
						}
					}
					return;
				}
			}
			if (barDrawingStyle == BarDrawingStyle.Emboss)
			{
				RectangleF ef8 = this.GetAbsoluteRectangle(position);
				float num6 = 4f;
				if ((ef8.Width < 6f) || (ef8.Height < 6f))
				{
					num6 = 2f;
				}
				else if ((ef8.Width < 15f) || (ef8.Height < 15f))
				{
					num6 = 3f;
				}
				SizeF ef9 = this.GetRelativeSize(new SizeF(num6, num6));
				Point3D[] pointdArray3 = new Point3D[] { new Point3D(position.Left, position.Bottom, positionZ + depth), new Point3D(position.Left, position.Top, positionZ + depth), new Point3D(position.Right, position.Top, positionZ + depth), new Point3D(position.Right - ef9.Width, position.Top + ef9.Height, positionZ + depth), new Point3D(position.Left + ef9.Width, position.Top + ef9.Height, positionZ + depth), new Point3D(position.Left + ef9.Width, position.Bottom - ef9.Height, positionZ + depth) };
				matrix.TransformPoints(pointdArray3);
				PointF[] tfArray3 = new PointF[6];
				for (int m = 0; m < pointdArray3.Length; m++)
				{
					tfArray3[m] = this.GetAbsolutePoint(pointdArray3[m].PointF);
				}
				using (GraphicsPath path6 = new GraphicsPath())
				{
					path6.AddPolygon(tfArray3);
					using (SolidBrush brush6 = new SolidBrush(Color.FromArgb(100, Color.White)))
					{
						this.FillPath(brush6, path6);
					}
				}
				pointdArray3[0] = new Point3D(position.Right, position.Top, positionZ + depth);
				pointdArray3[1] = new Point3D(position.Right, position.Bottom, positionZ + depth);
				pointdArray3[2] = new Point3D(position.Left, position.Bottom, positionZ + depth);
				pointdArray3[3] = new Point3D(position.Left + ef9.Width, position.Bottom - ef9.Height, positionZ + depth);
				pointdArray3[4] = new Point3D(position.Right - ef9.Width, position.Bottom - ef9.Height, positionZ + depth);
				pointdArray3[5] = new Point3D(position.Right - ef9.Width, position.Top + ef9.Height, positionZ + depth);
				matrix.TransformPoints(pointdArray3);
				for (int n = 0; n < pointdArray3.Length; n++)
				{
					tfArray3[n] = this.GetAbsolutePoint(pointdArray3[n].PointF);
				}
				using (GraphicsPath path7 = new GraphicsPath())
				{
					path7.AddPolygon(tfArray3);
					using (SolidBrush brush7 = new SolidBrush(Color.FromArgb(80, Color.Black)))
					{
						this.FillPath(brush7, path7);
					}
				}
			}
		}

		internal void DrawCircleAbs(System.Drawing.Pen pen, Brush brush, RectangleF position, int polygonSectorsNumber, bool circle3D)
		{
			bool flag = circle3D && (brush != null);
			if ((polygonSectorsNumber <= 2) && !flag)
			{
				if (brush != null)
				{
					this.FillEllipse(brush, position);
				}
				if (pen != null)
				{
					this.DrawEllipse(pen, position);
				}
			}
			else
			{
				PointF tf = new PointF(position.X + (position.Width / 2f), position.Y);
				PointF point = new PointF(position.X + (position.Width / 2f), position.Y + (position.Height / 2f));
				float sectorSize = 0f;
				PointF empty = PointF.Empty;
				float angle = 0f;
				using (GraphicsPath path = new GraphicsPath())
				{
					System.Drawing.Drawing2D.SmoothingMode smoothingMode = this.SmoothingMode;
					if (flag)
					{
						this.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
					}
					if (polygonSectorsNumber <= 2)
					{
						sectorSize = 1f;
					}
					else
					{
						sectorSize = 360f / ((float)polygonSectorsNumber);
					}
					angle = 0f;
					while (angle < 360f)
					{
						Matrix matrix = new Matrix();
						matrix.RotateAt(angle, point);
						PointF[] pts = new PointF[] { tf };
						matrix.TransformPoints(pts);
						if (!empty.IsEmpty)
						{
							path.AddLine(empty, pts[0]);
							if (flag)
							{
								path.AddLine(pts[0], point);
								path.AddLine(point, empty);
								using (Brush brush2 = this.GetSector3DBrush(brush, angle, sectorSize))
								{
									this.FillPath(brush2, path);
								}
								path.Reset();
							}
						}
						empty = pts[0];
						angle += sectorSize;
					}
					path.CloseAllFigures();
					if (!empty.IsEmpty && flag)
					{
						path.AddLine(empty, tf);
						path.AddLine(tf, point);
						path.AddLine(point, empty);
						using (Brush brush3 = this.GetSector3DBrush(brush, angle, sectorSize))
						{
							this.FillPath(brush3, path);
						}
						path.Reset();
					}
					if (flag)
					{
						this.SmoothingMode = smoothingMode;
					}
					if ((brush != null) && !circle3D)
					{
						this.FillPath(brush, path);
					}
					if (pen != null)
					{
						this.DrawPath(pen, path);
					}
				}
			}
		}

		internal void DrawCurve(System.Drawing.Pen pen, PointF[] points, int offset, int numberOfSegments, float tension)
		{
			ChartGraphics graphics = this;
			if ((graphics == null) || !graphics.IsMetafile)
			{
				this.RenderingObject.DrawCurve(pen, points, offset, numberOfSegments, tension);
			}
			else
			{
				PointF[] tfArray = null;
				if ((offset == 0) && (numberOfSegments == (points.Length - 1)))
				{
					this.RenderingObject.DrawCurve(pen, points, offset, numberOfSegments, tension);
				}
				else
				{
					if ((offset == 0) && (numberOfSegments < (points.Length - 1)))
					{
						tfArray = new PointF[numberOfSegments + 2];
						for (int i = 0; i < (numberOfSegments + 2); i++)
						{
							tfArray[i] = points[i];
						}
					}
					else if ((offset > 0) && ((offset + numberOfSegments) == (points.Length - 1)))
					{
						tfArray = new PointF[numberOfSegments + 2];
						for (int j = 0; j < (numberOfSegments + 2); j++)
						{
							tfArray[j] = points[(offset + j) - 1];
						}
						offset = 1;
					}
					else if ((offset > 0) && ((offset + numberOfSegments) < (points.Length - 1)))
					{
						tfArray = new PointF[numberOfSegments + 3];
						for (int k = 0; k < (numberOfSegments + 3); k++)
						{
							tfArray[k] = points[(offset + k) - 1];
						}
						offset = 1;
					}
					this.RenderingObject.DrawCurve(pen, tfArray, offset, numberOfSegments, tension);
				}
			}
		}

		internal void DrawEllipse(System.Drawing.Pen pen, RectangleF rect)
		{
			this.RenderingObject.DrawEllipse(pen, rect);
		}

		internal void DrawEllipse(System.Drawing.Pen pen, float x, float y, float width, float height)
		{
			this.RenderingObject.DrawEllipse(pen, x, y, width, height);
		}

		private void DrawGraphicsPath(System.Drawing.Pen pen, GraphicsPath path)
		{
			if (pen.Width < 2f)
			{
				this.DrawPath(pen, path);
			}
			else
			{
				path.Flatten();
				pen.EndCap = LineCap.Round;
				pen.StartCap = LineCap.Round;
				PointF[] pathPoints = path.PathPoints;
				for (int i = 0; i < (path.PathPoints.Length - 1); i++)
				{
					PointF[] tfArray2 = new PointF[] { pathPoints[i], pathPoints[i + 1] };
					this.DrawLine(pen, tfArray2[0], tfArray2[1]);
				}
			}
		}

		internal void DrawImage(Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr)
		{
			this.RenderingObject.DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr);
		}

		internal void DrawImage(Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs)
		{
			this.RenderingObject.DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttrs);
		}

		internal void DrawLabelStringRel(Axis axis, int labelRowIndex, LabelMarkStyle labelMark, Color markColor, string text, string image, Color imageTransparentColor, Font font, Brush brush, RectangleF position, StringFormat format, int angle, RectangleF boundaryRect, CustomLabel label, bool truncatedLeft, bool truncatedRight)
		{
			Matrix transform;
			using (StringFormat format2 = (StringFormat)format.Clone())
			{
				SizeF empty = SizeF.Empty;
				if ((position.Width == 0f) || (position.Height == 0f))
				{
					return;
				}
				RectangleF absoluteRectangle = this.GetAbsoluteRectangle(position);
				if (absoluteRectangle.Width < 1f)
				{
					absoluteRectangle.Width = 1f;
				}
				if (absoluteRectangle.Height < 1f)
				{
					absoluteRectangle.Height = 1f;
				}
				CommonElements common = axis.Common;
				if (common.ProcessModeRegions)
				{
					common.HotRegionsList.AddHotRegion(Rectangle.Round(absoluteRectangle), label, ChartElementType.AxisLabels, false, true);
				}
				if (labelRowIndex > 0)
				{
					format2.LineAlignment = StringAlignment.Center;
					format2.Alignment = StringAlignment.Center;
					angle = 0;
					if (axis.AxisPosition == AxisPosition.Left)
					{
						angle = -90;
					}
					else if (axis.AxisPosition == AxisPosition.Right)
					{
						angle = 90;
					}
					else if (axis.AxisPosition != AxisPosition.Top)
					{
						AxisPosition axisPosition = axis.AxisPosition;
					}
				}
				PointF point = PointF.Empty;
				if (axis.AxisPosition == AxisPosition.Left)
				{
					point.X = absoluteRectangle.Right;
					point.Y = absoluteRectangle.Y + (absoluteRectangle.Height / 2f);
				}
				else if (axis.AxisPosition == AxisPosition.Right)
				{
					point.X = absoluteRectangle.Left;
					point.Y = absoluteRectangle.Y + (absoluteRectangle.Height / 2f);
				}
				else if (axis.AxisPosition == AxisPosition.Top)
				{
					point.X = absoluteRectangle.X + (absoluteRectangle.Width / 2f);
					point.Y = absoluteRectangle.Bottom;
				}
				else if (axis.AxisPosition == AxisPosition.Bottom)
				{
					point.X = absoluteRectangle.X + (absoluteRectangle.Width / 2f);
					point.Y = absoluteRectangle.Top;
				}
				if (((axis.AxisPosition == AxisPosition.Top) || (axis.AxisPosition == AxisPosition.Bottom)) && (angle != 0))
				{
					point.X = absoluteRectangle.X + (absoluteRectangle.Width / 2f);
					point.Y = (axis.AxisPosition == AxisPosition.Top) ? absoluteRectangle.Bottom : absoluteRectangle.Y;
					RectangleF ef3 = RectangleF.Empty;
					ef3.X = absoluteRectangle.X + (absoluteRectangle.Width / 2f);
					ef3.Y = absoluteRectangle.Y - (absoluteRectangle.Width / 2f);
					ef3.Height = absoluteRectangle.Width;
					ef3.Width = absoluteRectangle.Height;
					if (axis.AxisPosition == AxisPosition.Bottom)
					{
						if (angle < 0)
						{
							ef3.X -= ef3.Width;
						}
						format2.Alignment = StringAlignment.Near;
						if (angle < 0)
						{
							format2.Alignment = StringAlignment.Far;
						}
						format2.LineAlignment = StringAlignment.Center;
					}
					if (axis.AxisPosition == AxisPosition.Top)
					{
						ef3.Y += absoluteRectangle.Height;
						if (angle > 0)
						{
							ef3.X -= ef3.Width;
						}
						format2.Alignment = StringAlignment.Far;
						if (angle < 0)
						{
							format2.Alignment = StringAlignment.Near;
						}
						format2.LineAlignment = StringAlignment.Center;
					}
					absoluteRectangle = ef3;
				}
				if (((axis.AxisPosition == AxisPosition.Left) || (axis.AxisPosition == AxisPosition.Right)) && ((angle == 90) || (angle == -90)))
				{
					point.X = absoluteRectangle.X + (absoluteRectangle.Width / 2f);
					point.Y = absoluteRectangle.Y + (absoluteRectangle.Height / 2f);
					RectangleF ef4 = RectangleF.Empty;
					ef4.X = point.X - (absoluteRectangle.Height / 2f);
					ef4.Y = point.Y - (absoluteRectangle.Width / 2f);
					ef4.Height = absoluteRectangle.Width;
					ef4.Width = absoluteRectangle.Height;
					absoluteRectangle = ef4;
					StringAlignment alignment = format2.Alignment;
					format2.Alignment = format2.LineAlignment;
					format2.LineAlignment = alignment;
					if (angle == 90)
					{
						if (format2.LineAlignment == StringAlignment.Far)
						{
							format2.LineAlignment = StringAlignment.Near;
						}
						else if (format2.LineAlignment == StringAlignment.Near)
						{
							format2.LineAlignment = StringAlignment.Far;
						}
					}
					if (angle == -90)
					{
						if (format2.Alignment == StringAlignment.Far)
						{
							format2.Alignment = StringAlignment.Near;
						}
						else if (format2.Alignment == StringAlignment.Near)
						{
							format2.Alignment = StringAlignment.Far;
						}
					}
				}
				transform = null;
				if (angle != 0)
				{
					this._myMatrix = this.Transform.Clone();
					this._myMatrix.RotateAt((float)angle, point);
					transform = this.Transform;
					this.Transform = this._myMatrix;
				}
				RectangleF rect = Rectangle.Empty;
				float offsetY = 0f;
				float offsetX = 0f;
				empty = this.MeasureString(text.Replace(@"\n", "\n"), font, absoluteRectangle.Size, format2);
				rect.Width = empty.Width;
				rect.Height = empty.Height;
				if (format2.Alignment == StringAlignment.Far)
				{
					rect.X = absoluteRectangle.Right - empty.Width;
				}
				else if (format2.Alignment == StringAlignment.Near)
				{
					rect.X = absoluteRectangle.X;
				}
				else if (format2.Alignment == StringAlignment.Center)
				{
					rect.X = (absoluteRectangle.X + (absoluteRectangle.Width / 2f)) - (empty.Width / 2f);
				}
				if (format2.LineAlignment == StringAlignment.Far)
				{
					rect.Y = absoluteRectangle.Bottom - empty.Height;
				}
				else if (format2.LineAlignment == StringAlignment.Near)
				{
					rect.Y = absoluteRectangle.Y;
				}
				else if (format2.LineAlignment == StringAlignment.Center)
				{
					rect.Y = (absoluteRectangle.Y + (absoluteRectangle.Height / 2f)) - (empty.Height / 2f);
				}
				if (((angle != 0) && (angle != 90)) && (angle != -90))
				{
					offsetY = (((float)Math.Sin((((float)(90 - angle)) / 180f) * 3.1415926535897931)) * rect.Height) / 2f;
					offsetX = (((float)Math.Sin((((float)Math.Abs(angle)) / 180f) * 3.1415926535897931)) * rect.Height) / 2f;
					if (axis.AxisPosition == AxisPosition.Left)
					{
						this._myMatrix.Translate(-offsetX, 0f);
					}
					else if (axis.AxisPosition == AxisPosition.Right)
					{
						this._myMatrix.Translate(offsetX, 0f);
					}
					else if (axis.AxisPosition == AxisPosition.Top)
					{
						this._myMatrix.Translate(0f, -offsetY);
					}
					else if (axis.AxisPosition == AxisPosition.Bottom)
					{
						this._myMatrix.Translate(0f, offsetY);
					}
					if (boundaryRect != RectangleF.Empty)
					{
						Region region = new Region(rect);
						region.Transform(this._myMatrix);
						if (axis.AxisPosition == AxisPosition.Left)
						{
							boundaryRect.Width += boundaryRect.X;
							boundaryRect.X = 0f;
						}
						else if (axis.AxisPosition == AxisPosition.Right)
						{
							boundaryRect.Width = this._common.Width - boundaryRect.X;
						}
						else if (axis.AxisPosition == AxisPosition.Top)
						{
							boundaryRect.Height += boundaryRect.Y;
							boundaryRect.Y = 0f;
						}
						else if (axis.AxisPosition == AxisPosition.Bottom)
						{
							boundaryRect.Height = this._common.Height - boundaryRect.Y;
						}
						region.Exclude(this.GetAbsoluteRectangle(boundaryRect));
						if (!region.IsEmpty(this.Graphics))
						{
							this.Transform = transform;
							float num3 = region.GetBounds(this.Graphics).Width / ((float)Math.Cos((((float)Math.Abs(angle)) / 180f) * 3.1415926535897931));
							if (axis.AxisPosition == AxisPosition.Left)
							{
								num3 -= rect.Height * ((float)Math.Tan((((float)Math.Abs(angle)) / 180f) * 3.1415926535897931));
								absoluteRectangle.Y = rect.Y;
								absoluteRectangle.X = rect.X + num3;
								absoluteRectangle.Width = rect.Width - num3;
								absoluteRectangle.Height = rect.Height;
							}
							else if (axis.AxisPosition == AxisPosition.Right)
							{
								num3 -= rect.Height * ((float)Math.Tan((((float)Math.Abs(angle)) / 180f) * 3.1415926535897931));
								absoluteRectangle.Y = rect.Y;
								absoluteRectangle.X = rect.X;
								absoluteRectangle.Width = rect.Width - num3;
								absoluteRectangle.Height = rect.Height;
							}
							else if (axis.AxisPosition == AxisPosition.Top)
							{
								absoluteRectangle.Y = rect.Y;
								absoluteRectangle.X = rect.X;
								absoluteRectangle.Width = rect.Width - num3;
								absoluteRectangle.Height = rect.Height;
								if (angle > 0)
								{
									absoluteRectangle.X += num3;
								}
							}
							else if (axis.AxisPosition == AxisPosition.Bottom)
							{
								absoluteRectangle.Y = rect.Y;
								absoluteRectangle.X = rect.X;
								absoluteRectangle.Width = rect.Width - num3;
								absoluteRectangle.Height = rect.Height;
								if (angle < 0)
								{
									absoluteRectangle.X += num3;
								}
							}
						}
					}
					this.Transform = this._myMatrix;
				}
				RectangleF layoutRectangle = new RectangleF(absoluteRectangle.Location, absoluteRectangle.Size);
				Image image2 = null;
				SizeF size = new SizeF();
				if (image.Length > 0)
				{
					image2 = axis.Common.ImageLoader.LoadImage(label.Image);
					if (image2 != null)
					{
						ImageLoader.GetAdjustedImageSize(image2, this.Graphics, ref size);
						layoutRectangle.Width -= size.Width;
						layoutRectangle.X += size.Width;
					}
					if (layoutRectangle.Width < 1f)
					{
						layoutRectangle.Width = 1f;
					}
				}
				if ((labelRowIndex > 0) && (labelMark != LabelMarkStyle.None))
				{
					empty = this.MeasureString(text.Replace(@"\n", "\n"), font, layoutRectangle.Size, format2);
					SizeF labelSize = new SizeF(empty.Width, empty.Height);
					if (image2 != null)
					{
						labelSize.Width += size.Width;
					}
					this.DrawSecondRowLabelMark(axis, markColor, absoluteRectangle, labelSize, labelMark, truncatedLeft, truncatedRight, transform);
				}
				if ((format2.FormatFlags & StringFormatFlags.LineLimit) != 0)
				{
					format2.FormatFlags ^= StringFormatFlags.LineLimit;
					if (this.MeasureString("I", font, absoluteRectangle.Size, format2).Height < absoluteRectangle.Height)
					{
						format2.FormatFlags |= StringFormatFlags.LineLimit;
					}
				}
				else
				{
					if ((format2.FormatFlags & StringFormatFlags.NoClip) != 0)
					{
						format2.FormatFlags ^= StringFormatFlags.NoClip;
					}
					SizeF ef11 = this.MeasureString("I", font, absoluteRectangle.Size, format2);
					format2.FormatFlags ^= StringFormatFlags.NoClip;
					if (ef11.Height > absoluteRectangle.Height)
					{
						float num4 = ef11.Height - absoluteRectangle.Height;
						absoluteRectangle.Y -= num4 / 2f;
						absoluteRectangle.Height += num4;
					}
				}
				this.DrawString(text.Replace(@"\n", "\n"), font, brush, layoutRectangle, format2);
				if (common.ProcessModeRegions)
				{
					using (GraphicsPath path = new GraphicsPath())
					{
						path.AddRectangle(rect);
						path.Transform(this.Transform);
						string hRef = string.Empty;
						string mapAreaAttributes = string.Empty;
						string postBackValue = string.Empty;
						hRef = label.Url;
						mapAreaAttributes = label.MapAreaAttributes;
						postBackValue = label.PostBackValue;
						common.HotRegionsList.AddHotRegion(this, path, false, label.ToolTip, hRef, mapAreaAttributes, postBackValue, label, ChartElementType.AxisLabels);
					}
				}
				if (image2 != null)
				{
					if (empty.IsEmpty)
					{
						empty = this.MeasureString(text.Replace(@"\n", "\n"), font, layoutRectangle.Size, format2);
					}
					RectangleF ef12 = new RectangleF(absoluteRectangle.X + (((absoluteRectangle.Width - size.Width) - empty.Width) / 2f), absoluteRectangle.Y + ((absoluteRectangle.Height - size.Height) / 2f), size.Width, size.Height);
					if (format2.LineAlignment == StringAlignment.Center)
					{
						ef12.Y = absoluteRectangle.Y + ((absoluteRectangle.Height - size.Height) / 2f);
					}
					else if (format2.LineAlignment == StringAlignment.Far)
					{
						ef12.Y = absoluteRectangle.Bottom - ((empty.Height + size.Height) / 2f);
					}
					else if (format2.LineAlignment == StringAlignment.Near)
					{
						ef12.Y = absoluteRectangle.Top + ((empty.Height - size.Height) / 2f);
					}
					if (format2.Alignment == StringAlignment.Center)
					{
						ef12.X = absoluteRectangle.X + (((absoluteRectangle.Width - size.Width) - empty.Width) / 2f);
					}
					else if (format2.Alignment == StringAlignment.Far)
					{
						ef12.X = (absoluteRectangle.Right - size.Width) - empty.Width;
					}
					else if (format2.Alignment == StringAlignment.Near)
					{
						ef12.X = absoluteRectangle.X;
					}
					ImageAttributes imageAttr = new ImageAttributes();
					if (imageTransparentColor != Color.Empty)
					{
						imageAttr.SetColorKey(imageTransparentColor, imageTransparentColor, ColorAdjustType.Default);
					}
					this.DrawImage(image2, Rectangle.Round(ef12), 0, 0, image2.Width, image2.Height, GraphicsUnit.Pixel, imageAttr);
					if (common.ProcessModeRegions)
					{
						using (GraphicsPath path2 = new GraphicsPath())
						{
							path2.AddRectangle(ef12);
							path2.Transform(this.Transform);
							string imageUrl = string.Empty;
							string imageMapAreaAttributes = string.Empty;
							string str6 = string.Empty;
							imageUrl = label.ImageUrl;
							imageMapAreaAttributes = label.ImageMapAreaAttributes;
							str6 = label.PostBackValue;
							common.HotRegionsList.AddHotRegion(this, path2, false, string.Empty, imageUrl, imageMapAreaAttributes, str6, label, ChartElementType.AxisLabelImage);
						}
					}
				}
			}
			if (transform != null)
			{
				this.Transform = transform;
			}
		}

		internal void DrawLine(System.Drawing.Pen pen, PointF pt1, PointF pt2)
		{
			this.RenderingObject.DrawLine(pen, pt1, pt2);
		}

		internal void DrawLine(System.Drawing.Pen pen, float x1, float y1, float x2, float y2)
		{
			this.RenderingObject.DrawLine(pen, x1, y1, x2, y2);
		}

		internal void DrawLineAbs(Color color, int width, ChartDashStyle style, PointF firstPoint, PointF secondPoint)
		{
			if ((width != 0) && (style != ChartDashStyle.NotSet))
			{
				if (this._pen.Color != color)
				{
					this._pen.Color = color;
				}
				if (this._pen.Width != width)
				{
					this._pen.Width = width;
				}
				if (this._pen.DashStyle != this.GetPenStyle(style))
				{
					this._pen.DashStyle = this.GetPenStyle(style);
				}
				System.Drawing.Drawing2D.SmoothingMode smoothingMode = this.SmoothingMode;
				if (((width <= 1) && (style != ChartDashStyle.Solid)) && ((firstPoint.X == secondPoint.X) || (firstPoint.Y == secondPoint.Y)))
				{
					this.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
				}
				this.DrawLine(this._pen, (float)Math.Round((double)firstPoint.X), (float)Math.Round((double)firstPoint.Y), (float)Math.Round((double)secondPoint.X), (float)Math.Round((double)secondPoint.Y));
				this.SmoothingMode = smoothingMode;
			}
		}

		internal void DrawLineAbs(Color color, int width, ChartDashStyle style, PointF firstPoint, PointF secondPoint, Color shadowColor, int shadowOffset)
		{
			if (shadowOffset != 0)
			{
				Color color2;
				if (shadowColor.A != 0xff)
				{
					color2 = shadowColor;
				}
				else
				{
					color2 = Color.FromArgb(color.A / 2, shadowColor);
				}
				PointF tf = new PointF(firstPoint.X + shadowOffset, firstPoint.Y + shadowOffset);
				PointF tf2 = new PointF(secondPoint.X + shadowOffset, secondPoint.Y + shadowOffset);
				this.DrawLineAbs(color2, width, style, tf, tf2);
			}
			this.DrawLineAbs(color, width, style, firstPoint, secondPoint);
		}

		internal void DrawLineRel(Color color, int width, ChartDashStyle style, PointF firstPointF, PointF secondPointF)
		{
			this.DrawLineAbs(color, width, style, this.GetAbsolutePoint(firstPointF), this.GetAbsolutePoint(secondPointF));
		}

		internal void DrawLineRel(Color color, int width, ChartDashStyle style, PointF firstPoint, PointF secondPoint, Color shadowColor, int shadowOffset)
		{
			this.DrawLineAbs(color, width, style, this.GetAbsolutePoint(firstPoint), this.GetAbsolutePoint(secondPoint), shadowColor, shadowOffset);
		}

		internal void DrawLines(System.Drawing.Pen pen, PointF[] points)
		{
			this.RenderingObject.DrawLines(pen, points);
		}

		internal GraphicsPath DrawMarker3D(Matrix3D matrix, LightStyle lightStyle, float positionZ, PointF point, MarkerStyle markerStyle, int markerSize, Color markerColor, Color markerBorderColor, int markerBorderSize, string markerImage, Color markerImageTransparentColor, int shadowSize, Color shadowColor, RectangleF imageScaleRect, DrawingOperationTypes operationType)
		{
			ChartGraphics graphics = this;
			GraphicsPath path = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath) ? new GraphicsPath() : null;
			Point3D[] points = new Point3D[] { new Point3D(point.X, point.Y, positionZ) };
			matrix.TransformPoints(points);
			PointF pointF = points[0].PointF;
			pointF = graphics.GetAbsolutePoint(pointF);
			if ((markerImage.Length > 0) || ((markerStyle != MarkerStyle.Circle) && (markerStyle != MarkerStyle.Square)))
			{
				if ((operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement)
				{
					graphics.DrawMarkerAbs(pointF, markerStyle, markerSize, markerColor, markerBorderColor, markerBorderSize, markerImage, markerImageTransparentColor, shadowSize, shadowColor, imageScaleRect, false);
				}
				if ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
				{
					RectangleF empty = RectangleF.Empty;
					empty.X = pointF.X - (((float)markerSize) / 2f);
					empty.Y = pointF.Y - (((float)markerSize) / 2f);
					empty.Width = markerSize;
					empty.Height = markerSize;
					path.AddRectangle(empty);
				}
				return path;
			}
			if (((markerStyle == MarkerStyle.None) || (markerSize <= 0)) || !(markerColor != Color.Empty))
			{
				return path;
			}
			using (new SolidBrush(markerColor))
			{
				RectangleF rect = RectangleF.Empty;
				rect.X = pointF.X - (((float)markerSize) / 2f);
				rect.Y = pointF.Y - (((float)markerSize) / 2f);
				rect.Width = markerSize;
				rect.Height = markerSize;
				SizeF relativeSize = graphics.GetRelativeSize(new SizeF((float)markerSize, (float)markerSize));
				switch (markerStyle)
				{
					case MarkerStyle.Square:
						{
							RectangleF position = RectangleF.Empty;
							position.X = point.X - (relativeSize.Width / 2f);
							position.Y = point.Y - (relativeSize.Height / 2f);
							position.Width = relativeSize.Width;
							position.Height = relativeSize.Height;
							return this.Fill3DRectangle(position, positionZ - (relativeSize.Width / 2f), relativeSize.Width, matrix, lightStyle, markerColor, markerBorderColor, markerBorderSize, ChartDashStyle.Solid, operationType);
						}
					case MarkerStyle.Circle:
						break;

					default:
						throw new InvalidOperationException(SR.ExceptionGraphics3DMarkerStyleUnknown);
				}
				if ((operationType & DrawingOperationTypes.DrawElement) != DrawingOperationTypes.DrawElement)
				{
					goto Label_0467;
				}
				if ((shadowSize != 0) && (shadowColor != Color.Empty))
				{
					if (!graphics.softShadows)
					{
						using (Brush brush2 = new SolidBrush((shadowColor.A != 0xff) ? shadowColor : Color.FromArgb(markerColor.A / 2, shadowColor)))
						{
							RectangleF ef4 = rect;
							ef4.X += shadowSize;
							ef4.Y += shadowSize;
							graphics.FillEllipse(brush2, ef4);
							goto Label_0348;
						}
					}
					using (GraphicsPath path2 = new GraphicsPath())
					{
						path2.AddEllipse((float)((rect.X + shadowSize) - 1f), (float)((rect.Y + shadowSize) - 1f), (float)(rect.Width + 2f), (float)(rect.Height + 2f));
						using (PathGradientBrush brush3 = new PathGradientBrush(path2))
						{
							brush3.CenterColor = shadowColor;
							Color[] colorArray = new Color[] { Color.Transparent };
							brush3.SurroundColors = colorArray;
							brush3.CenterPoint = new PointF(pointF.X, pointF.Y);
							PointF tf2 = new PointF(1f - ((2f * shadowSize) / rect.Width), 1f - ((2f * shadowSize) / rect.Height));
							if (tf2.X < 0f)
							{
								tf2.X = 0f;
							}
							if (tf2.Y < 0f)
							{
								tf2.Y = 0f;
							}
							brush3.FocusScales = tf2;
							graphics.FillPath(brush3, path2);
						}
					}
				}
			Label_0348:
				using (GraphicsPath path3 = new GraphicsPath())
				{
					RectangleF ef5 = new RectangleF(rect.Location, rect.Size);
					ef5.Inflate(ef5.Width / 4f, ef5.Height / 4f);
					path3.AddEllipse(ef5);
					using (PathGradientBrush brush4 = new PathGradientBrush(path3))
					{
						brush4.CenterColor = GetGradientColor(markerColor, Color.White, 0.85);
						brush4.SurroundColors = new Color[] { markerColor };
						Point3D[] pointdArray2 = new Point3D[] { new Point3D(point.X, point.Y, positionZ + relativeSize.Width) };
						matrix.TransformPoints(pointdArray2);
						pointdArray2[0].PointF = graphics.GetAbsolutePoint(pointdArray2[0].PointF);
						brush4.CenterPoint = pointdArray2[0].PointF;
						graphics.FillEllipse(brush4, rect);
						graphics.DrawEllipse(new System.Drawing.Pen(markerBorderColor, (float)markerBorderSize), rect);
					}
				}
			Label_0467:
				if ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath)
				{
					path.AddEllipse(rect);
				}
				return path;
			}
		}

		internal void DrawMarkerAbs(PointF point, MarkerStyle markerStyle, int markerSize, Color markerColor, Color markerBorderColor, int markerBorderSize, string markerImage, Color markerImageTransparentColor, int shadowSize, Color shadowColor, RectangleF imageScaleRect, bool forceAntiAlias)
		{
			if (markerBorderSize <= 0)
			{
				markerBorderColor = Color.Transparent;
			}
			if (markerImage.Length > 0)
			{
				Image image = this._common.ImageLoader.LoadImage(markerImage);
				if (image != null)
				{
					RectangleF empty = RectangleF.Empty;
					if (imageScaleRect == RectangleF.Empty)
					{
						SizeF size = new SizeF();
						ImageLoader.GetAdjustedImageSize(image, this.Graphics, ref size);
						imageScaleRect.Width = size.Width;
						imageScaleRect.Height = size.Height;
					}
					empty.X = point.X - (imageScaleRect.Width / 2f);
					empty.Y = point.Y - (imageScaleRect.Height / 2f);
					empty.Width = imageScaleRect.Width;
					empty.Height = imageScaleRect.Height;
					ImageAttributes imageAttr = new ImageAttributes();
					if (markerImageTransparentColor != Color.Empty)
					{
						imageAttr.SetColorKey(markerImageTransparentColor, markerImageTransparentColor, ColorAdjustType.Default);
					}
					if ((shadowSize != 0) && (shadowColor != Color.Empty))
					{
						ImageAttributes attributes2 = new ImageAttributes();
						attributes2.SetColorKey(markerImageTransparentColor, markerImageTransparentColor, ColorAdjustType.Default);
						ColorMatrix newColorMatrix = new ColorMatrix();
						newColorMatrix.Matrix00 = 0.25f;
						newColorMatrix.Matrix11 = 0.25f;
						newColorMatrix.Matrix22 = 0.25f;
						newColorMatrix.Matrix33 = 0.5f;
						newColorMatrix.Matrix44 = 1f;
						attributes2.SetColorMatrix(newColorMatrix);
						this.DrawImage(image, new Rectangle(((int)empty.X) + shadowSize, ((int)empty.Y) + shadowSize, (int)empty.Width, (int)empty.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes2);
					}
					this.DrawImage(image, new Rectangle((int)empty.X, (int)empty.Y, (int)empty.Width, (int)empty.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, imageAttr);
					return;
				}
				return;
			}
			if (((markerStyle == MarkerStyle.None) || (markerSize <= 0)) || !(markerColor != Color.Empty))
			{
				return;
			}
			System.Drawing.Drawing2D.SmoothingMode smoothingMode = this.SmoothingMode;
			if (forceAntiAlias)
			{
				this.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
			}
			using (SolidBrush brush = new SolidBrush(markerColor))
			{
				int num;
				PointF[] tfArray;
				float num2;
				Matrix matrix7;
				PointF[] tfArray3;
				PointF[] tfArray4;
				RectangleF rect = RectangleF.Empty;
				rect.X = point.X - (((float)markerSize) / 2f);
				rect.Y = point.Y - (((float)markerSize) / 2f);
				rect.Width = markerSize;
				rect.Height = markerSize;
				switch (markerStyle)
				{
					case MarkerStyle.Square:
						if ((shadowSize != 0) && (shadowColor != Color.Empty))
						{
							this.FillRectangleShadowAbs(rect, shadowColor, (float)shadowSize, shadowColor);
						}
						this.FillRectangle(brush, rect);
						this.DrawRectangle(new System.Drawing.Pen(markerBorderColor, (float)markerBorderSize), (int)Math.Round((double)rect.X, 0), (int)Math.Round((double)rect.Y, 0), (int)Math.Round((double)rect.Width, 0), (int)Math.Round((double)rect.Height, 0));
						goto Label_0F26;

					case MarkerStyle.Circle:
						goto Label_0356;

					case MarkerStyle.Diamond:
						goto Label_0A9E;

					case MarkerStyle.Triangle:
						goto Label_0CD0;

					case MarkerStyle.Cross:
						goto Label_05B2;

					case MarkerStyle.Star4:
					case MarkerStyle.Star5:
					case MarkerStyle.Star6:
					case MarkerStyle.Star10:
						num = 4;
						if (markerStyle != MarkerStyle.Star5)
						{
							break;
						}
						num = 5;
						goto Label_02B6;

					default:
						throw new InvalidOperationException(SR.ExceptionGraphicsMarkerStyleUnknown);
				}
				if (markerStyle == MarkerStyle.Star6)
				{
					num = 6;
				}
				else if (markerStyle == MarkerStyle.Star10)
				{
					num = 10;
				}
			Label_02B6:
				tfArray = this.CreateStarPolygon(rect, num);
				if ((shadowSize != 0) && (shadowColor != Color.Empty))
				{
					Matrix matrix2 = this.Transform.Clone();
					matrix2.Translate((float)shadowSize, (float)shadowSize);
					Matrix matrix3 = this.Transform;
					this.Transform = matrix2;
					this.FillPolygon(new SolidBrush((shadowColor.A != 0xff) ? shadowColor : Color.FromArgb(markerColor.A / 2, shadowColor)), tfArray);
					this.Transform = matrix3;
				}
				this.FillPolygon(brush, tfArray);
				this.DrawPolygon(new System.Drawing.Pen(markerBorderColor, (float)markerBorderSize), tfArray);
				goto Label_0F26;
			Label_0356:
				if ((shadowSize != 0) && (shadowColor != Color.Empty))
				{
					if (!this.softShadows)
					{
						using (SolidBrush brush2 = new SolidBrush((shadowColor.A != 0xff) ? shadowColor : Color.FromArgb(markerColor.A / 2, shadowColor)))
						{
							RectangleF ef4 = rect;
							ef4.X += shadowSize;
							ef4.Y += shadowSize;
							this.FillEllipse(brush2, ef4);
							goto Label_0515;
						}
					}
					using (GraphicsPath path = new GraphicsPath())
					{
						path.AddEllipse((float)((rect.X + shadowSize) - 1f), (float)((rect.Y + shadowSize) - 1f), (float)(rect.Width + 2f), (float)(rect.Height + 2f));
						using (PathGradientBrush brush3 = new PathGradientBrush(path))
						{
							brush3.CenterColor = shadowColor;
							Color[] colorArray = new Color[] { Color.Transparent };
							brush3.SurroundColors = colorArray;
							brush3.CenterPoint = new PointF(point.X, point.Y);
							PointF tf = new PointF(1f - ((2f * shadowSize) / rect.Width), 1f - ((2f * shadowSize) / rect.Height));
							if (tf.X < 0f)
							{
								tf.X = 0f;
							}
							if (tf.Y < 0f)
							{
								tf.Y = 0f;
							}
							brush3.FocusScales = tf;
							this.FillPath(brush3, path);
						}
					}
				}
			Label_0515:
				this.FillEllipse(brush, rect);
				this.DrawEllipse(new System.Drawing.Pen(markerBorderColor, (float)markerBorderSize), rect);
				goto Label_0F26;
			Label_05B2:
				num2 = (float)Math.Ceiling((double)(((float)markerSize) / 4f));
				float num3 = markerSize;
				PointF[] pts = new PointF[12];
				pts[0].X = point.X - (num3 / 2f);
				pts[0].Y = point.Y + (num2 / 2f);
				pts[1].X = point.X - (num3 / 2f);
				pts[1].Y = point.Y - (num2 / 2f);
				pts[2].X = point.X - (num2 / 2f);
				pts[2].Y = point.Y - (num2 / 2f);
				pts[3].X = point.X - (num2 / 2f);
				pts[3].Y = point.Y - (num3 / 2f);
				pts[4].X = point.X + (num2 / 2f);
				pts[4].Y = point.Y - (num3 / 2f);
				pts[5].X = point.X + (num2 / 2f);
				pts[5].Y = point.Y - (num2 / 2f);
				pts[6].X = point.X + (num3 / 2f);
				pts[6].Y = point.Y - (num2 / 2f);
				pts[7].X = point.X + (num3 / 2f);
				pts[7].Y = point.Y + (num2 / 2f);
				pts[8].X = point.X + (num2 / 2f);
				pts[8].Y = point.Y + (num2 / 2f);
				pts[9].X = point.X + (num2 / 2f);
				pts[9].Y = point.Y + (num3 / 2f);
				pts[10].X = point.X - (num2 / 2f);
				pts[10].Y = point.Y + (num3 / 2f);
				pts[11].X = point.X - (num2 / 2f);
				pts[11].Y = point.Y + (num2 / 2f);
				Matrix matrix4 = new Matrix();
				matrix4.RotateAt(45f, point);
				matrix4.TransformPoints(pts);
				if ((shadowSize == 0) || !(shadowColor != Color.Empty))
				{
					goto Label_0A58;
				}
				Matrix matrix5 = this.Transform.Clone();
				matrix5.Translate(this.softShadows ? ((float)(shadowSize + 1)) : ((float)shadowSize), this.softShadows ? ((float)(shadowSize + 1)) : ((float)shadowSize));
				Matrix transform = this.Transform;
				this.Transform = matrix5;
				if (!this.softShadows)
				{
					using (Brush brush4 = new SolidBrush((shadowColor.A != 0xff) ? shadowColor : Color.FromArgb(markerColor.A / 2, shadowColor)))
					{
						this.FillPolygon(brush4, pts);
						goto Label_0A50;
					}
				}
				using (GraphicsPath path2 = new GraphicsPath())
				{
					path2.AddPolygon(pts);
					using (PathGradientBrush brush5 = new PathGradientBrush(path2))
					{
						brush5.CenterColor = shadowColor;
						Color[] colorArray2 = new Color[] { Color.Transparent };
						brush5.SurroundColors = colorArray2;
						brush5.CenterPoint = new PointF(point.X, point.Y);
						PointF tf2 = new PointF(1f - ((2f * shadowSize) / rect.Width), 1f - ((2f * shadowSize) / rect.Height));
						if (tf2.X < 0f)
						{
							tf2.X = 0f;
						}
						if (tf2.Y < 0f)
						{
							tf2.Y = 0f;
						}
						brush5.FocusScales = tf2;
						this.FillPath(brush5, path2);
					}
				}
			Label_0A50:
				this.Transform = transform;
			Label_0A58:
				matrix7 = this.Transform.Clone();
				Matrix matrix8 = this.Transform;
				this.Transform = matrix7;
				this.FillPolygon(brush, pts);
				this.DrawPolygon(new System.Drawing.Pen(markerBorderColor, (float)markerBorderSize), pts);
				this.Transform = matrix8;
				goto Label_0F26;
			Label_0A9E:
				tfArray3 = new PointF[4];
				tfArray3[0].X = rect.X;
				tfArray3[0].Y = rect.Y + (rect.Height / 2f);
				tfArray3[1].X = rect.X + (rect.Width / 2f);
				tfArray3[1].Y = rect.Top;
				tfArray3[2].X = rect.Right;
				tfArray3[2].Y = rect.Y + (rect.Height / 2f);
				tfArray3[3].X = rect.X + (rect.Width / 2f);
				tfArray3[3].Y = rect.Bottom;
				if ((shadowSize == 0) || !(shadowColor != Color.Empty))
				{
					goto Label_0CAF;
				}
				Matrix matrix9 = this.Transform.Clone();
				matrix9.Translate(this.softShadows ? ((float)0) : ((float)shadowSize), this.softShadows ? ((float)0) : ((float)shadowSize));
				Matrix matrix10 = this.Transform;
				this.Transform = matrix9;
				if (!this.softShadows)
				{
					using (Brush brush6 = new SolidBrush((shadowColor.A != 0xff) ? shadowColor : Color.FromArgb(markerColor.A / 2, shadowColor)))
					{
						this.FillPolygon(brush6, tfArray3);
						goto Label_0CA7;
					}
				}
				float num4 = markerSize * ((float)Math.Sin(0.78539816339744828));
				RectangleF ef5 = RectangleF.Empty;
				ef5.X = point.X - (num4 / 2f);
				ef5.Y = (point.Y - (num4 / 2f)) - shadowSize;
				ef5.Width = num4;
				ef5.Height = num4;
				matrix9.RotateAt(45f, point);
				this.Transform = matrix9;
				this.FillRectangleShadowAbs(ef5, shadowColor, (float)shadowSize, shadowColor);
			Label_0CA7:
				this.Transform = matrix10;
			Label_0CAF:
				this.FillPolygon(brush, tfArray3);
				this.DrawPolygon(new System.Drawing.Pen(markerBorderColor, (float)markerBorderSize), tfArray3);
				goto Label_0F26;
			Label_0CD0:
				tfArray4 = new PointF[3];
				tfArray4[0].X = rect.X;
				tfArray4[0].Y = rect.Bottom;
				tfArray4[1].X = rect.X + (rect.Width / 2f);
				tfArray4[1].Y = rect.Top;
				tfArray4[2].X = rect.Right;
				tfArray4[2].Y = rect.Bottom;
				if ((shadowSize == 0) || !(shadowColor != Color.Empty))
				{
					goto Label_0EEF;
				}
				Matrix matrix11 = this.Transform.Clone();
				matrix11.Translate(this.softShadows ? ((float)(shadowSize - 1)) : ((float)shadowSize), this.softShadows ? ((float)(shadowSize + 1)) : ((float)shadowSize));
				Matrix matrix12 = this.Transform;
				this.Transform = matrix11;
				if (!this.softShadows)
				{
					using (Brush brush7 = new SolidBrush((shadowColor.A != 0xff) ? shadowColor : Color.FromArgb(markerColor.A / 2, shadowColor)))
					{
						this.FillPolygon(brush7, tfArray4);
						goto Label_0EE7;
					}
				}
				GraphicsPath path3 = new GraphicsPath();
				path3.AddPolygon(tfArray4);
				PathGradientBrush brush8 = new PathGradientBrush(path3);
				brush8.CenterColor = shadowColor;
				Color[] colorArray3 = new Color[] { Color.Transparent };
				brush8.SurroundColors = colorArray3;
				brush8.CenterPoint = new PointF(point.X, point.Y);
				PointF tf3 = new PointF(1f - ((2f * shadowSize) / rect.Width), 1f - ((2f * shadowSize) / rect.Height));
				if (tf3.X < 0f)
				{
					tf3.X = 0f;
				}
				if (tf3.Y < 0f)
				{
					tf3.Y = 0f;
				}
				brush8.FocusScales = tf3;
				this.FillPath(brush8, path3);
			Label_0EE7:
				this.Transform = matrix12;
			Label_0EEF:
				this.FillPolygon(brush, tfArray4);
				this.DrawPolygon(new System.Drawing.Pen(markerBorderColor, (float)markerBorderSize), tfArray4);
			}
		Label_0F26:
			if (forceAntiAlias)
			{
				this.SmoothingMode = smoothingMode;
			}
		}

		internal void DrawMarkerRel(PointF point, MarkerStyle markerStyle, int markerSize, Color markerColor, Color markerBorderColor, int markerBorderSize, string markerImage, Color markerImageTransparentColor, int shadowSize, Color shadowColor, RectangleF imageScaleRect)
		{
			this.DrawMarkerAbs(this.GetAbsolutePoint(point), markerStyle, markerSize, markerColor, markerBorderColor, markerBorderSize, markerImage, markerImageTransparentColor, shadowSize, shadowColor, imageScaleRect, false);
		}

		internal void DrawPath(System.Drawing.Pen pen, GraphicsPath path)
		{
			if ((path != null) && (path.PointCount != 0))
			{
				this.RenderingObject.DrawPath(pen, path);
			}
		}

		internal void DrawPathAbs(GraphicsPath path, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageWrapMode, Color backImageTransparentColor, ChartImageAlignmentStyle backImageAlign, GradientStyle backGradientStyle, Color backSecondaryColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, PenAlignment penAlignment)
		{
			Brush brush = null;
			Brush brush2 = null;
			if (backColor.IsEmpty)
			{
				backColor = Color.White;
			}
			if (backSecondaryColor.IsEmpty)
			{
				backSecondaryColor = Color.White;
			}
			if (borderColor.IsEmpty)
			{
				borderColor = Color.White;
				borderWidth = 0;
			}
			this._pen.Color = borderColor;
			this._pen.Width = borderWidth;
			this._pen.Alignment = penAlignment;
			this._pen.DashStyle = this.GetPenStyle(borderDashStyle);
			if (backGradientStyle == GradientStyle.None)
			{
				this._solidBrush.Color = backColor;
				brush = this._solidBrush;
			}
			else
			{
				RectangleF rectangle = path.GetBounds();
				rectangle.Inflate(new SizeF(2f, 2f));
				brush = this.GetGradientBrush(rectangle, backColor, backSecondaryColor, backGradientStyle);
			}
			if (backHatchStyle != ChartHatchStyle.None)
			{
				brush = this.GetHatchBrush(backHatchStyle, backColor, backSecondaryColor);
			}
			if (((backImage.Length > 0) && (backImageWrapMode != ChartImageWrapMode.Unscaled)) && (backImageWrapMode != ChartImageWrapMode.Scaled))
			{
				brush2 = brush;
				brush = this.GetTextureBrush(backImage, backImageTransparentColor, backImageWrapMode, backColor);
			}
			RectangleF bounds = path.GetBounds();
			if ((backImage.Length > 0) && ((backImageWrapMode == ChartImageWrapMode.Unscaled) || (backImageWrapMode == ChartImageWrapMode.Scaled)))
			{
				Image image = this._common.ImageLoader.LoadImage(backImage);
				ImageAttributes imageAttr = new ImageAttributes();
				if (backImageTransparentColor != Color.Empty)
				{
					imageAttr.SetColorKey(backImageTransparentColor, backImageTransparentColor, ColorAdjustType.Default);
				}
				RectangleF ef3 = new RectangleF();
				ef3.X = bounds.X;
				ef3.Y = bounds.Y;
				ef3.Width = bounds.Width;
				ef3.Height = bounds.Height;
				if (backImageWrapMode == ChartImageWrapMode.Unscaled)
				{
					SizeF size = new SizeF();
					ImageLoader.GetAdjustedImageSize(image, this.Graphics, ref size);
					ef3.Width = size.Width;
					ef3.Height = size.Height;
					if (ef3.Width < bounds.Width)
					{
						if (((backImageAlign == ChartImageAlignmentStyle.BottomRight) || (backImageAlign == ChartImageAlignmentStyle.Right)) || (backImageAlign == ChartImageAlignmentStyle.TopRight))
						{
							ef3.X = bounds.Right - ef3.Width;
						}
						else if (((backImageAlign == ChartImageAlignmentStyle.Bottom) || (backImageAlign == ChartImageAlignmentStyle.Center)) || (backImageAlign == ChartImageAlignmentStyle.Top))
						{
							ef3.X = bounds.X + ((bounds.Width - ef3.Width) / 2f);
						}
					}
					if (ef3.Height < bounds.Height)
					{
						if (((backImageAlign == ChartImageAlignmentStyle.BottomRight) || (backImageAlign == ChartImageAlignmentStyle.Bottom)) || (backImageAlign == ChartImageAlignmentStyle.BottomLeft))
						{
							ef3.Y = bounds.Bottom - ef3.Height;
						}
						else if (((backImageAlign == ChartImageAlignmentStyle.Left) || (backImageAlign == ChartImageAlignmentStyle.Center)) || (backImageAlign == ChartImageAlignmentStyle.Right))
						{
							ef3.Y = bounds.Y + ((bounds.Height - ef3.Height) / 2f);
						}
					}
				}
				this.FillPath(brush, path);
				Region clip = this.Clip;
				this.Clip = new Region(path);
				this.DrawImage(image, new Rectangle((int)Math.Round((double)ef3.X), (int)Math.Round((double)ef3.Y), (int)Math.Round((double)ef3.Width), (int)Math.Round((double)ef3.Height)), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, imageAttr);
				this.Clip = clip;
			}
			else
			{
				if ((brush2 != null) && (backImageTransparentColor != Color.Empty))
				{
					this.FillPath(brush2, path);
				}
				this.FillPath(brush, path);
			}
			if (((borderColor != Color.Empty) && (borderWidth > 0)) && (borderDashStyle != ChartDashStyle.NotSet))
			{
				this.DrawPath(this._pen, path);
			}
		}

		internal void DrawPathAbs(GraphicsPath path, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageWrapMode, Color backImageTransparentColor, ChartImageAlignmentStyle backImageAlign, GradientStyle backGradientStyle, Color backSecondaryColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, PenAlignment penAlignment, int shadowOffset, Color shadowColor)
		{
			if ((shadowOffset != 0) && (shadowColor != Color.Transparent))
			{
				GraphicsState gstate = this.Save();
				this.TranslateTransform((float)shadowOffset, (float)shadowOffset);
				if ((backColor == Color.Transparent) && backSecondaryColor.IsEmpty)
				{
					this.DrawPathAbs(path, Color.Transparent, ChartHatchStyle.None, string.Empty, ChartImageWrapMode.Scaled, Color.Empty, ChartImageAlignmentStyle.Center, GradientStyle.None, Color.Empty, shadowColor, borderWidth, borderDashStyle, PenAlignment.Center);
				}
				else
				{
					this.DrawPathAbs(path, shadowColor, ChartHatchStyle.None, string.Empty, ChartImageWrapMode.Scaled, Color.Empty, ChartImageAlignmentStyle.Center, GradientStyle.None, Color.Empty, Color.Transparent, 0, ChartDashStyle.NotSet, PenAlignment.Center);
				}
				this.Restore(gstate);
			}
			this.DrawPathAbs(path, backColor, backHatchStyle, backImage, backImageWrapMode, backImageTransparentColor, backImageAlign, backGradientStyle, backSecondaryColor, borderColor, borderWidth, borderDashStyle, penAlignment);
		}

		internal void DrawPie(System.Drawing.Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
		{
			this.RenderingObject.DrawPie(pen, x, y, width, height, startAngle, sweepAngle);
		}

		private void DrawPieGradientEffects(PieDrawingStyle pieDrawingStyle, RectangleF position, float startAngle, float sweepAngle, float doughnutRadius)
		{
			if (pieDrawingStyle == PieDrawingStyle.Concave)
			{
				float num = Math.Min(position.Width, position.Height);
				float num2 = num * 0.05f;
				RectangleF rect = position;
				rect.Inflate(-num2, -num2);
				using (GraphicsPath path = new GraphicsPath())
				{
					path.AddEllipse(rect);
					using (GraphicsPath path2 = new GraphicsPath())
					{
						if (doughnutRadius < 0f)
						{
							path2.AddPie(Rectangle.Round(rect), startAngle, sweepAngle);
						}
						else
						{
							path2.AddArc((float)(((rect.X + ((position.Width * doughnutRadius) / 200f)) - 1f) - num2), (float)(((rect.Y + ((position.Height * doughnutRadius) / 200f)) - 1f) - num2), (float)(((rect.Width - ((position.Width * doughnutRadius) / 100f)) + 2f) + (2f * num2)), (float)(((rect.Height - ((position.Height * doughnutRadius) / 100f)) + 2f) + (2f * num2)), startAngle, sweepAngle);
							path2.AddArc(rect.X, rect.Y, rect.Width, rect.Height, startAngle + sweepAngle, -sweepAngle);
						}
						rect.Inflate(1f, 1f);
						using (LinearGradientBrush brush = new LinearGradientBrush(rect, Color.Red, Color.Green, LinearGradientMode.Vertical))
						{
							ColorBlend blend = new ColorBlend(3);
							blend.Colors[0] = Color.FromArgb(100, Color.Black);
							blend.Colors[1] = Color.Transparent;
							blend.Colors[2] = Color.FromArgb(140, Color.White);
							blend.Positions[0] = 0f;
							blend.Positions[1] = 0.5f;
							blend.Positions[2] = 1f;
							brush.InterpolationColors = blend;
							this.FillPath(brush, path2);
						}
					}
					return;
				}
			}
			if (pieDrawingStyle == PieDrawingStyle.SoftEdge)
			{
				float num3 = Math.Min(position.Width, position.Height);
				float num4 = num3 / 10f;
				if (doughnutRadius > 0f)
				{
					num4 = ((num3 * doughnutRadius) / 100f) / 8f;
				}
				using (GraphicsPath path3 = new GraphicsPath())
				{
					path3.AddEllipse(position);
					using (GraphicsPath path4 = new GraphicsPath())
					{
						path4.AddArc((float)(position.X + num4), (float)(position.Y + num4), (float)(position.Width - (num4 * 2f)), (float)(position.Height - (num4 * 2f)), startAngle, sweepAngle);
						path4.AddArc(position.X, position.Y, position.Width, position.Height, startAngle + sweepAngle, -sweepAngle);
						path4.CloseFigure();
						using (PathGradientBrush brush2 = new PathGradientBrush(path3))
						{
							brush2.CenterColor = Color.Transparent;
							brush2.SurroundColors = new Color[] { Color.FromArgb(100, Color.Black) };
							Blend blend2 = new Blend(3);
							blend2.Positions[0] = 0f;
							blend2.Factors[0] = 0f;
							blend2.Positions[1] = num4 / (num3 / 2f);
							blend2.Factors[1] = 1f;
							blend2.Positions[2] = 1f;
							blend2.Factors[2] = 1f;
							brush2.Blend = blend2;
							this.FillPath(brush2, path4);
						}
					}
					if (doughnutRadius > 0f)
					{
						using (GraphicsPath path5 = new GraphicsPath())
						{
							RectangleF ef2 = position;
							ef2.Inflate(((-position.Width * doughnutRadius) / 200f) + num4, ((-position.Height * doughnutRadius) / 200f) + num4);
							path5.AddEllipse(ef2);
							using (GraphicsPath path6 = new GraphicsPath())
							{
								path6.AddArc((float)(ef2.X + num4), (float)(ef2.Y + num4), (float)(ef2.Width - (2f * num4)), (float)(ef2.Height - (2f * num4)), startAngle, sweepAngle);
								path6.AddArc(ef2.X, ef2.Y, ef2.Width, ef2.Height, startAngle + sweepAngle, -sweepAngle);
								path6.CloseFigure();
								using (PathGradientBrush brush3 = new PathGradientBrush(path5))
								{
									brush3.CenterColor = Color.FromArgb(100, Color.Black);
									brush3.SurroundColors = new Color[] { Color.Transparent };
									Blend blend3 = new Blend(3);
									blend3.Positions[0] = 0f;
									blend3.Factors[0] = 0f;
									blend3.Positions[1] = num4 / (ef2.Width / 2f);
									blend3.Factors[1] = 1f;
									blend3.Positions[2] = 1f;
									blend3.Factors[2] = 1f;
									brush3.Blend = blend3;
									this.FillPath(brush3, path6);
								}
							}
						}
					}
				}
			}
		}

		internal void DrawPieRel(RectangleF rect, float startAngle, float sweepAngle, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageWrapMode, Color backImageTransparentColor, GradientStyle backGradientStyle, Color backSecondaryColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, bool shadow, bool doughnut, float doughnutRadius, PieDrawingStyle pieDrawingStyle)
		{
			System.Drawing.Pen pen = null;
			Brush brush;
			RectangleF absoluteRectangle = this.GetAbsoluteRectangle(rect);
			if (doughnutRadius == 100.0)
			{
				doughnut = false;
			}
			if (doughnutRadius == 0.0)
			{
				return;
			}
			if (backHatchStyle != ChartHatchStyle.None)
			{
				brush = this.GetHatchBrush(backHatchStyle, backColor, backSecondaryColor);
			}
			else
			{
				if (backGradientStyle != GradientStyle.None)
				{
					if (backGradientStyle == GradientStyle.Center)
					{
						brush = this.GetPieGradientBrush(absoluteRectangle, backColor, backSecondaryColor);
						goto Label_00CE;
					}
					using (GraphicsPath path = new GraphicsPath())
					{
						path.AddPie(absoluteRectangle.X, absoluteRectangle.Y, absoluteRectangle.Width, absoluteRectangle.Height, startAngle, sweepAngle);
						brush = this.GetGradientBrush(path.GetBounds(), backColor, backSecondaryColor, backGradientStyle);
						goto Label_00CE;
					}
				}
				if (((backImage.Length > 0) && (backImageWrapMode != ChartImageWrapMode.Unscaled)) && (backImageWrapMode != ChartImageWrapMode.Scaled))
				{
					brush = this.GetTextureBrush(backImage, backImageTransparentColor, backImageWrapMode, backColor);
				}
				else
				{
					brush = new SolidBrush(backColor);
				}
			}
		Label_00CE:
			pen = new System.Drawing.Pen(borderColor, (float)borderWidth);
			pen.DashStyle = this.GetPenStyle(borderDashStyle);
			pen.LineJoin = LineJoin.Round;
			if (doughnut)
			{
				using (GraphicsPath path2 = new GraphicsPath())
				{
					path2.AddArc((float)((absoluteRectangle.X + ((absoluteRectangle.Width * doughnutRadius) / 200f)) - 1f), (float)((absoluteRectangle.Y + ((absoluteRectangle.Height * doughnutRadius) / 200f)) - 1f), (float)((absoluteRectangle.Width - ((absoluteRectangle.Width * doughnutRadius) / 100f)) + 2f), (float)((absoluteRectangle.Height - ((absoluteRectangle.Height * doughnutRadius) / 100f)) + 2f), startAngle, sweepAngle);
					path2.AddArc(absoluteRectangle.X, absoluteRectangle.Y, absoluteRectangle.Width, absoluteRectangle.Height, startAngle + sweepAngle, -sweepAngle);
					path2.CloseFigure();
					this.FillPath(brush, path2);
					this.DrawPieGradientEffects(pieDrawingStyle, absoluteRectangle, startAngle, sweepAngle, doughnutRadius);
					if ((!shadow && (borderWidth > 0)) && (borderDashStyle != ChartDashStyle.NotSet))
					{
						this.DrawPath(pen, path2);
					}
					goto Label_0269;
				}
			}
			if (shadow && this.softShadows)
			{
				this.DrawPieSoftShadow(startAngle, sweepAngle, absoluteRectangle, backColor);
			}
			else
			{
				this.FillPie(brush, absoluteRectangle.X, absoluteRectangle.Y, absoluteRectangle.Width, absoluteRectangle.Height, startAngle, sweepAngle);
				this.DrawPieGradientEffects(pieDrawingStyle, absoluteRectangle, startAngle, sweepAngle, -1f);
			}
			if ((!shadow && (borderWidth > 0)) && (borderDashStyle != ChartDashStyle.NotSet))
			{
				this.DrawPie(pen, absoluteRectangle.X, absoluteRectangle.Y, absoluteRectangle.Width, absoluteRectangle.Height, startAngle, sweepAngle);
			}
		Label_0269:
			if (pen != null)
			{
				pen.Dispose();
			}
			if (brush != null)
			{
				brush.Dispose();
			}
		}

		private void DrawPieSoftShadow(float startAngle, float sweepAngle, RectangleF absRect, Color backColor)
		{
			GraphicsPath path = new GraphicsPath();
			path.AddEllipse(absRect.X, absRect.Y, absRect.Width, absRect.Height);
			PathGradientBrush brush = new PathGradientBrush(path);
			Color[] colorArray = new Color[] { Color.FromArgb(0, backColor), Color.FromArgb(backColor.A, backColor), Color.FromArgb(backColor.A, backColor) };
			float[] numArray2 = new float[3];
			numArray2[1] = 0.05f;
			numArray2[2] = 1f;
			float[] numArray = numArray2;
			ColorBlend blend = new ColorBlend();
			blend.Colors = colorArray;
			blend.Positions = numArray;
			brush.InterpolationColors = blend;
			this.FillPie(brush, absRect.X, absRect.Y, absRect.Width, absRect.Height, startAngle, sweepAngle);
		}

		private void DrawPointLabelBackground(CommonElements common, int angle, PointF textPosition, RectangleF backPosition, Color backColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, Series series, DataPoint point, int pointIndex)
		{
			if (!backPosition.IsEmpty)
			{
				RectangleF rect = this.Round(this.GetAbsoluteRectangle(backPosition));
				PointF empty = PointF.Empty;
				if (textPosition.IsEmpty)
				{
					empty = new PointF(rect.X + (rect.Width / 2f), rect.Y + (rect.Height / 2f));
				}
				else
				{
					empty = this.GetAbsolutePoint(textPosition);
				}
				this._myMatrix = this.Transform.Clone();
				this._myMatrix.RotateAt((float)angle, empty);
				GraphicsState gstate = this.Save();
				this.Transform = this._myMatrix;
				if (!backColor.IsEmpty || !borderColor.IsEmpty)
				{
					using (Brush brush = new SolidBrush(backColor))
					{
						this.FillRectangle(brush, rect);
					}
					if (((borderWidth > 0) && !borderColor.IsEmpty) && (borderDashStyle != ChartDashStyle.NotSet))
					{
						AntiAliasingStyles antiAliasing = this.AntiAliasing;
						try
						{
							this.AntiAliasing = AntiAliasingStyles.None;
							using (System.Drawing.Pen pen = new System.Drawing.Pen(borderColor, (float)borderWidth))
							{
								pen.DashStyle = this.GetPenStyle(borderDashStyle);
								this.DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height);
							}
						}
						finally
						{
							this.AntiAliasing = antiAliasing;
						}
					}
				}
				else
				{
					using (Brush brush2 = new SolidBrush(Color.Transparent))
					{
						this.FillRectangle(brush2, rect);
					}
				}
				this.Restore(gstate);
				if ((common != null) && common.ProcessModeRegions)
				{
					string toolTip = point.ToolTip;
					string url = point.Url;
					string mapAreaAttributes = point.MapAreaAttributes;
					object tag = point.Tag;
					string postBackValue = point.PostBackValue;
					point.ToolTip = point.LabelToolTip;
					point.Url = point.LabelUrl;
					point.MapAreaAttributes = point.LabelMapAreaAttributes;
					point.PostBackValue = point.PostBackValue;
					if (angle == 0)
					{
						common.HotRegionsList.AddHotRegion(backPosition, point, series.Name, pointIndex);
					}
					else
					{
						using (GraphicsPath path = new GraphicsPath())
						{
							path.AddRectangle(rect);
							path.Transform(this._myMatrix);
							common.HotRegionsList.AddHotRegion(path, false, this, point, series.Name, pointIndex);
						}
					}
					point.ToolTip = toolTip;
					point.Url = url;
					point.MapAreaAttributes = mapAreaAttributes;
					point.Tag = tag;
					point.PostBackValue = postBackValue;
					if ((common.HotRegionsList.List != null) && (common.HotRegionsList.List.Count > 0))
					{
						((HotRegion)common.HotRegionsList.List[common.HotRegionsList.List.Count - 1]).Type = ChartElementType.DataPointLabel;
					}
				}
			}
		}

		internal void DrawPointLabelStringRel(CommonElements common, string text, Font font, Brush brush, PointF position, StringFormat format, int angle, RectangleF backPosition, Color backColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, Series series, DataPoint point, int pointIndex)
		{
			this.StartHotRegion(point, true);
			this.DrawPointLabelBackground(common, angle, position, backPosition, backColor, borderColor, borderWidth, borderDashStyle, series, point, pointIndex);
			this.EndHotRegion();
			this.DrawStringRel(text, font, brush, position, format, angle);
		}

		internal void DrawPointLabelStringRel(CommonElements common, string text, Font font, Brush brush, RectangleF position, StringFormat format, int angle, RectangleF backPosition, Color backColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, Series series, DataPoint point, int pointIndex)
		{
			this.StartHotRegion(point, true);
			this.DrawPointLabelBackground(common, angle, PointF.Empty, backPosition, backColor, borderColor, borderWidth, borderDashStyle, series, point, pointIndex);
			this.EndHotRegion();
			this.DrawStringRel(text, font, brush, position, format, angle);
		}

		internal void DrawPolygon(System.Drawing.Pen pen, PointF[] points)
		{
			this.RenderingObject.DrawPolygon(pen, points);
		}

		internal void DrawRectangle(System.Drawing.Pen pen, int x, int y, int width, int height)
		{
			this.RenderingObject.DrawRectangle(pen, x, y, width, height);
		}

		internal void DrawRectangle(System.Drawing.Pen pen, float x, float y, float width, float height)
		{
			this.RenderingObject.DrawRectangle(pen, x, y, width, height);
		}

		internal void DrawRectangleBarStyle(BarDrawingStyle barDrawingStyle, bool isVertical, RectangleF rect)
		{
			if (((barDrawingStyle != BarDrawingStyle.Default) && (rect.Width > 0f)) && (rect.Height > 0f))
			{
				if (barDrawingStyle == BarDrawingStyle.Cylinder)
				{
					RectangleF ef = rect;
					if (isVertical)
					{
						ef.Width *= 0.3f;
					}
					else
					{
						ef.Height *= 0.3f;
					}
					if ((ef.Width > 0f) && (ef.Height > 0f))
					{
						this.FillRectangleAbs(ef, Color.Transparent, ChartHatchStyle.None, string.Empty, ChartImageWrapMode.Scaled, Color.Empty, ChartImageAlignmentStyle.Center, isVertical ? GradientStyle.LeftRight : GradientStyle.TopBottom, Color.FromArgb(120, Color.White), Color.Empty, 0, ChartDashStyle.NotSet, PenAlignment.Inset);
						if (isVertical)
						{
							ef.X += ef.Width + 1f;
							ef.Width = rect.Right - ef.X;
						}
						else
						{
							ef.Y += ef.Height + 1f;
							ef.Height = rect.Bottom - ef.Y;
						}
						this.FillRectangleAbs(ef, Color.FromArgb(120, Color.White), ChartHatchStyle.None, string.Empty, ChartImageWrapMode.Scaled, Color.Empty, ChartImageAlignmentStyle.Center, isVertical ? GradientStyle.LeftRight : GradientStyle.TopBottom, Color.FromArgb(150, Color.Black), Color.Empty, 0, ChartDashStyle.NotSet, PenAlignment.Inset);
					}
				}
				else
				{
					if (barDrawingStyle == BarDrawingStyle.Emboss)
					{
						float num = 3f;
						if ((rect.Width < 6f) || (rect.Height < 6f))
						{
							num = 1f;
						}
						else if ((rect.Width < 15f) || (rect.Height < 15f))
						{
							num = 2f;
						}
						using (GraphicsPath path = new GraphicsPath())
						{
							PointF[] points = new PointF[] { new PointF(rect.Left, rect.Bottom), new PointF(rect.Left, rect.Top), new PointF(rect.Right, rect.Top), new PointF(rect.Right - num, rect.Top + num), new PointF(rect.Left + num, rect.Top + num), new PointF(rect.Left + num, rect.Bottom - num) };
							path.AddPolygon(points);
							using (SolidBrush brush = new SolidBrush(Color.FromArgb(100, Color.White)))
							{
								this.FillPath(brush, path);
							}
						}
						using (GraphicsPath path2 = new GraphicsPath())
						{
							PointF[] tfArray2 = new PointF[] { new PointF(rect.Right, rect.Top), new PointF(rect.Right, rect.Bottom), new PointF(rect.Left, rect.Bottom), new PointF(rect.Left + num, rect.Bottom - num), new PointF(rect.Right - num, rect.Bottom - num), new PointF(rect.Right - num, rect.Top + num) };
							path2.AddPolygon(tfArray2);
							using (SolidBrush brush2 = new SolidBrush(Color.FromArgb(80, Color.Black)))
							{
								this.FillPath(brush2, path2);
							}
							return;
						}
					}
					if (barDrawingStyle == BarDrawingStyle.LightToDark)
					{
						float num2 = 4f;
						if ((rect.Width < 6f) || (rect.Height < 6f))
						{
							num2 = 2f;
						}
						else if ((rect.Width < 15f) || (rect.Height < 15f))
						{
							num2 = 3f;
						}
						RectangleF ef2 = rect;
						ef2.Inflate(-num2, -num2);
						if (isVertical)
						{
							ef2.Height = (float)Math.Floor((double)(ef2.Height / 3f));
						}
						else
						{
							ef2.X = ef2.Right - ((float)Math.Floor((double)(ef2.Width / 3f)));
							ef2.Width = (float)Math.Floor((double)(ef2.Width / 3f));
						}
						if ((ef2.Width > 0f) && (ef2.Height > 0f))
						{
							this.FillRectangleAbs(ef2, isVertical ? Color.FromArgb(120, Color.White) : Color.Transparent, ChartHatchStyle.None, string.Empty, ChartImageWrapMode.Scaled, Color.Empty, ChartImageAlignmentStyle.Center, isVertical ? GradientStyle.TopBottom : GradientStyle.LeftRight, isVertical ? Color.Transparent : Color.FromArgb(120, Color.White), Color.Empty, 0, ChartDashStyle.NotSet, PenAlignment.Inset);
							ef2 = rect;
							ef2.Inflate(-num2, -num2);
							if (isVertical)
							{
								ef2.Y = ef2.Bottom - ((float)Math.Floor((double)(ef2.Height / 3f)));
								ef2.Height = (float)Math.Floor((double)(ef2.Height / 3f));
							}
							else
							{
								ef2.Width = (float)Math.Floor((double)(ef2.Width / 3f));
							}
							this.FillRectangleAbs(ef2, !isVertical ? Color.FromArgb(80, Color.Black) : Color.Transparent, ChartHatchStyle.None, string.Empty, ChartImageWrapMode.Scaled, Color.Empty, ChartImageAlignmentStyle.Center, isVertical ? GradientStyle.TopBottom : GradientStyle.LeftRight, !isVertical ? Color.Transparent : Color.FromArgb(80, Color.Black), Color.Empty, 0, ChartDashStyle.NotSet, PenAlignment.Inset);
						}
					}
					else if (barDrawingStyle == BarDrawingStyle.Wedge)
					{
						float num3 = isVertical ? (rect.Width / 2f) : (rect.Height / 2f);
						if (isVertical && ((2f * num3) > rect.Height))
						{
							num3 = rect.Height / 2f;
						}
						if (!isVertical && ((2f * num3) > rect.Width))
						{
							num3 = rect.Width / 2f;
						}
						RectangleF ef3 = rect;
						using (GraphicsPath path3 = new GraphicsPath())
						{
							if (isVertical)
							{
								path3.AddLine((float)(ef3.X + (ef3.Width / 2f)), (float)(ef3.Y + num3), (float)(ef3.X + (ef3.Width / 2f)), (float)(ef3.Bottom - num3));
								path3.AddLine(ef3.X + (ef3.Width / 2f), ef3.Bottom - num3, ef3.Right, ef3.Bottom);
								path3.AddLine(ef3.Right, ef3.Bottom, ef3.Right, ef3.Y);
							}
							else
							{
								path3.AddLine((float)(ef3.X + num3), (float)(ef3.Y + (ef3.Height / 2f)), (float)(ef3.Right - num3), (float)(ef3.Y + (ef3.Height / 2f)));
								path3.AddLine(ef3.Right - num3, ef3.Y + (ef3.Height / 2f), ef3.Right, ef3.Bottom);
								path3.AddLine(ef3.Right, ef3.Bottom, ef3.Left, ef3.Bottom);
							}
							path3.CloseAllFigures();
							using (SolidBrush brush3 = new SolidBrush(Color.FromArgb(90, Color.Black)))
							{
								this.FillPath(brush3, path3);
							}
						}
						using (GraphicsPath path4 = new GraphicsPath())
						{
							if (isVertical)
							{
								path4.AddLine(ef3.X, ef3.Y, ef3.X + (ef3.Width / 2f), ef3.Y + num3);
								path4.AddLine(ef3.X + (ef3.Width / 2f), ef3.Y + num3, ef3.Right, ef3.Y);
							}
							else
							{
								path4.AddLine(ef3.Right, ef3.Y, ef3.Right - num3, ef3.Y + (ef3.Height / 2f));
								path4.AddLine(ef3.Right - num3, ef3.Y + (ef3.Height / 2f), ef3.Right, ef3.Bottom);
							}
							using (SolidBrush brush4 = new SolidBrush(Color.FromArgb(50, Color.Black)))
							{
								this.FillPath(brush4, path4);
								using (System.Drawing.Pen pen = new System.Drawing.Pen(Color.FromArgb(20, Color.Black), 1f))
								{
									this.DrawPath(pen, path4);
									if (isVertical)
									{
										this.DrawLine(pen, rect.X + (rect.Width / 2f), rect.Y + num3, rect.X + (rect.Width / 2f), rect.Bottom - num3);
									}
									else
									{
										this.DrawLine(pen, rect.X + num3, rect.Y + (rect.Height / 2f), rect.X + num3, rect.Bottom - (rect.Height / 2f));
									}
								}
								using (System.Drawing.Pen pen2 = new System.Drawing.Pen(Color.FromArgb(40, Color.White), 1f))
								{
									this.DrawPath(pen2, path4);
									if (isVertical)
									{
										this.DrawLine(pen2, rect.X + (rect.Width / 2f), rect.Y + num3, rect.X + (rect.Width / 2f), rect.Bottom - num3);
									}
									else
									{
										this.DrawLine(pen2, rect.X + num3, rect.Y + (rect.Height / 2f), rect.X + num3, rect.Bottom - (rect.Height / 2f));
									}
								}
							}
						}
						using (GraphicsPath path5 = new GraphicsPath())
						{
							if (isVertical)
							{
								path5.AddLine(ef3.X, ef3.Bottom, ef3.X + (ef3.Width / 2f), ef3.Bottom - num3);
								path5.AddLine(ef3.X + (ef3.Width / 2f), ef3.Bottom - num3, ef3.Right, ef3.Bottom);
							}
							else
							{
								path5.AddLine(ef3.X, ef3.Y, ef3.X + num3, ef3.Y + (ef3.Height / 2f));
								path5.AddLine(ef3.X + num3, ef3.Y + (ef3.Height / 2f), ef3.X, ef3.Bottom);
							}
							using (SolidBrush brush5 = new SolidBrush(Color.FromArgb(50, Color.Black)))
							{
								this.FillPath(brush5, path5);
								using (System.Drawing.Pen pen3 = new System.Drawing.Pen(Color.FromArgb(20, Color.Black), 1f))
								{
									this.DrawPath(pen3, path5);
								}
								using (System.Drawing.Pen pen4 = new System.Drawing.Pen(Color.FromArgb(40, Color.White), 1f))
								{
									this.DrawPath(pen4, path5);
								}
							}
						}
					}
				}
			}
		}

		internal void DrawRoundedRectShadowAbs(RectangleF rect, float[] cornerRadius, float radius, Color centerColor, Color surroundColor, float shadowScale)
		{
			GraphicsPath path = this.CreateRoundedRectPath(rect, cornerRadius);
			PathGradientBrush brush = new PathGradientBrush(path);
			brush.CenterColor = centerColor;
			Color[] colorArray = new Color[] { surroundColor };
			brush.SurroundColors = colorArray;
			brush.CenterPoint = new PointF(rect.X + (rect.Width / 2f), rect.Y + (rect.Height / 2f));
			PointF tf = new PointF(1f - ((shadowScale * radius) / rect.Width), 1f - ((shadowScale * radius) / rect.Height));
			brush.FocusScales = tf;
			this.FillPath(brush, path);
			if (path != null)
			{
				path.Dispose();
			}
		}

		private void DrawSecondRowLabelBoxMark(Axis axis, Color markColor, RectangleF absPosition, bool truncatedLeft, bool truncatedRight, Matrix originalTransform)
		{
			Matrix transform = this.Transform;
			if (originalTransform != null)
			{
				this.Transform = originalTransform;
			}
			PointF tf = new PointF(absPosition.X + (absPosition.Width / 2f), absPosition.Y + (absPosition.Height / 2f));
			if ((axis.AxisPosition == AxisPosition.Left) || (axis.AxisPosition == AxisPosition.Right))
			{
				RectangleF empty = RectangleF.Empty;
				empty.X = tf.X - (absPosition.Height / 2f);
				empty.Y = tf.Y - (absPosition.Width / 2f);
				empty.Height = absPosition.Width;
				empty.Width = absPosition.Height;
				absPosition = empty;
			}
			float axisPosition = (float)axis.GetAxisPosition(true);
			PointF point = new PointF(axisPosition, axisPosition);
			point = this.GetAbsolutePoint(point);
			Rectangle rectangle = Rectangle.Round(absPosition);
			rectangle.Width = ((int)Math.Round((double)absPosition.Right)) - rectangle.X;
			rectangle.Height = ((int)Math.Round((double)absPosition.Bottom)) - rectangle.Y;
			System.Drawing.Pen pen = new System.Drawing.Pen(markColor.IsEmpty ? axis.MajorTickMark.LineColor : markColor, (float)axis.MajorTickMark.LineWidth);
			pen.DashStyle = this.GetPenStyle(axis.MajorTickMark.LineDashStyle);
			if ((axis.AxisPosition == AxisPosition.Left) || (axis.AxisPosition == AxisPosition.Right))
			{
				this.DrawLine(pen, (float)rectangle.Left, (float)rectangle.Top, (float)rectangle.Left, (float)rectangle.Bottom);
				this.DrawLine(pen, (float)rectangle.Right, (float)rectangle.Top, (float)rectangle.Right, (float)rectangle.Bottom);
			}
			else
			{
				this.DrawLine(pen, (float)rectangle.Left, (float)rectangle.Top, (float)rectangle.Right, (float)rectangle.Top);
				this.DrawLine(pen, (float)rectangle.Left, (float)rectangle.Bottom, (float)rectangle.Right, (float)rectangle.Bottom);
			}
			if (!truncatedLeft)
			{
				if ((axis.AxisPosition == AxisPosition.Left) || (axis.AxisPosition == AxisPosition.Right))
				{
					this.DrawLine(pen, (axis.AxisPosition == AxisPosition.Left) ? ((float)rectangle.Left) : ((float)rectangle.Right), (float)rectangle.Bottom, point.X, (float)rectangle.Bottom);
				}
				else
				{
					this.DrawLine(pen, (float)rectangle.Left, (axis.AxisPosition == AxisPosition.Top) ? ((float)rectangle.Top) : ((float)rectangle.Bottom), (float)rectangle.Left, point.Y);
				}
			}
			if (!truncatedRight)
			{
				if ((axis.AxisPosition == AxisPosition.Left) || (axis.AxisPosition == AxisPosition.Right))
				{
					this.DrawLine(pen, (axis.AxisPosition == AxisPosition.Left) ? ((float)rectangle.Left) : ((float)rectangle.Right), (float)rectangle.Top, point.X, (float)rectangle.Top);
				}
				else
				{
					this.DrawLine(pen, (float)rectangle.Right, (axis.AxisPosition == AxisPosition.Top) ? ((float)rectangle.Top) : ((float)rectangle.Bottom), (float)rectangle.Right, point.Y);
				}
			}
			if (pen != null)
			{
				pen.Dispose();
			}
			if (originalTransform != null)
			{
				this.Transform = transform;
			}
		}

		private void DrawSecondRowLabelMark(Axis axis, Color markColor, RectangleF absPosition, SizeF labelSize, LabelMarkStyle labelMark, bool truncatedLeft, bool truncatedRight, Matrix oldTransform)
		{
			if (((axis.MajorTickMark.LineWidth != 0) && (axis.MajorTickMark.LineDashStyle != ChartDashStyle.NotSet)) && (axis.MajorTickMark.LineColor != Color.Empty))
			{
				System.Drawing.Drawing2D.SmoothingMode smoothingMode = this.SmoothingMode;
				this.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
				if (labelMark == LabelMarkStyle.Box)
				{
					this.DrawSecondRowLabelBoxMark(axis, markColor, absPosition, truncatedLeft, truncatedRight, oldTransform);
				}
				else
				{
					Point point = Point.Round(new PointF(absPosition.X + (absPosition.Width / 2f), absPosition.Y + (absPosition.Height / 2f)));
					Rectangle rectangle = Rectangle.Round(absPosition);
					rectangle.Width = ((int)Math.Round((double)absPosition.Right)) - rectangle.X;
					rectangle.Height = ((int)Math.Round((double)absPosition.Bottom)) - rectangle.Y;
					PointF[] points = new PointF[3];
					PointF[] tfArray2 = new PointF[3];
					points[0].X = rectangle.Left;
					points[0].Y = rectangle.Bottom;
					points[1].X = rectangle.Left;
					points[1].Y = point.Y;
					points[2].X = (float)Math.Round((double)((point.X - (labelSize.Width / 2f)) - 1.0));
					points[2].Y = point.Y;
					tfArray2[0].X = rectangle.Right;
					tfArray2[0].Y = rectangle.Bottom;
					tfArray2[1].X = rectangle.Right;
					tfArray2[1].Y = point.Y;
					tfArray2[2].X = (float)Math.Round((double)((point.X + (labelSize.Width / 2f)) - 1.0));
					tfArray2[2].Y = point.Y;
					if (axis.AxisPosition == AxisPosition.Bottom)
					{
						points[0].Y = rectangle.Top;
						tfArray2[0].Y = rectangle.Top;
					}
					if (labelMark == LabelMarkStyle.SideMark)
					{
						points[2] = points[1];
						tfArray2[2] = tfArray2[1];
					}
					if (truncatedLeft)
					{
						points[0] = points[1];
					}
					if (truncatedRight)
					{
						tfArray2[0] = tfArray2[1];
					}
					System.Drawing.Pen pen = new System.Drawing.Pen(markColor.IsEmpty ? axis.MajorTickMark.LineColor : markColor, (float)axis.MajorTickMark.LineWidth);
					pen.DashStyle = this.GetPenStyle(axis.MajorTickMark.LineDashStyle);
					this.DrawLines(pen, points);
					this.DrawLines(pen, tfArray2);
					if (pen != null)
					{
						pen.Dispose();
					}
				}
				this.SmoothingMode = smoothingMode;
			}
		}

		internal void DrawString(string s, Font font, Brush brush, PointF point, StringFormat format)
		{
			this.RenderingObject.DrawString(s, font, brush, point, format);
		}

		internal void DrawString(string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
		{
			this.RenderingObject.DrawString(s, font, brush, layoutRectangle, format);
		}

		internal void DrawString(string text, Font font, Brush brush, RectangleF rect, StringFormat format, TextOrientation textOrientation)
		{
			if (textOrientation == TextOrientation.Stacked)
			{
				text = GetStackedText(text);
			}
			this.DrawString(text, font, brush, rect, format);
		}

		internal void DrawStringAbs(string text, Font font, Brush brush, PointF absPosition, StringFormat format, int angle)
		{
			this._myMatrix = this.Transform.Clone();
			this._myMatrix.RotateAt((float)angle, absPosition);
			GraphicsState gstate = this.Save();
			this.Transform = this._myMatrix;
			this.DrawString(text, font, brush, absPosition, format);
			this.Restore(gstate);
		}

		internal void DrawStringRel(string text, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
		{
			if ((layoutRectangle.Width != 0f) && (layoutRectangle.Height != 0f))
			{
				RectangleF absoluteRectangle = this.GetAbsoluteRectangle(layoutRectangle);
				this.DrawString(text, font, brush, absoluteRectangle, format);
			}
		}

		internal void DrawStringRel(string text, Font font, Brush brush, PointF position, StringFormat format, int angle)
		{
			this.DrawStringAbs(text, font, brush, this.GetAbsolutePoint(position), format, angle);
		}

		internal void DrawStringRel(string text, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format, int angle)
		{
			PointF empty = PointF.Empty;
			if ((layoutRectangle.Width != 0f) && (layoutRectangle.Height != 0f))
			{
				RectangleF absoluteRectangle = this.GetAbsoluteRectangle(layoutRectangle);
				SizeF ef2 = this.MeasureString(text, font, absoluteRectangle.Size, format);
				if (format.Alignment == StringAlignment.Near)
				{
					empty.X = absoluteRectangle.X + (ef2.Width / 2f);
					empty.Y = (absoluteRectangle.Bottom + absoluteRectangle.Top) / 2f;
				}
				else if (format.Alignment == StringAlignment.Far)
				{
					empty.X = absoluteRectangle.Right - (ef2.Width / 2f);
					empty.Y = (absoluteRectangle.Bottom + absoluteRectangle.Top) / 2f;
				}
				else
				{
					empty.X = (absoluteRectangle.Left + absoluteRectangle.Right) / 2f;
					empty.Y = (absoluteRectangle.Bottom + absoluteRectangle.Top) / 2f;
				}
				this._myMatrix = this.Transform.Clone();
				this._myMatrix.RotateAt((float)angle, empty);
				Matrix transform = this.Transform;
				this.Transform = this._myMatrix;
				this.DrawString(text, font, brush, absoluteRectangle, format);
				this.Transform = transform;
			}
		}

		internal void DrawStringRel(string text, Font font, Brush brush, RectangleF position, StringFormat format, TextOrientation textOrientation)
		{
			if (textOrientation == TextOrientation.Stacked)
			{
				text = GetStackedText(text);
			}
			this.DrawStringRel(text, font, brush, position, format);
		}

		internal void DrawStringRel(string text, Font font, Brush brush, PointF position, StringFormat format, int angle, TextOrientation textOrientation)
		{
			if (textOrientation == TextOrientation.Stacked)
			{
				text = GetStackedText(text);
			}
			this.DrawStringRel(text, font, brush, position, format, angle);
		}

		internal void EndHotRegion()
		{
			this.RenderingObject.EndSelection();
		}

		internal GraphicsPath Fill3DRectangle(RectangleF position, float positionZ, float depth, Matrix3D matrix, LightStyle lightStyle, Color backColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, DrawingOperationTypes operationType)
		{
			return this.Fill3DRectangle(position, positionZ, depth, matrix, lightStyle, backColor, 0f, 0f, borderColor, borderWidth, borderDashStyle, BarDrawingStyle.Default, false, operationType);
		}

		internal GraphicsPath Fill3DRectangle(RectangleF position, float positionZ, float depth, Matrix3D matrix, LightStyle lightStyle, Color backColor, float topRightDarkening, float bottomLeftDarkening, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, BarDrawingStyle barDrawingStyle, bool veticalOrientation, DrawingOperationTypes operationType)
		{
			Color color;
			Color color2;
			Color color3;
			Color color4;
			Color color5;
			Color color6;
			if (barDrawingStyle == BarDrawingStyle.Cylinder)
			{
				return this.Fill3DRectangleAsCylinder(position, positionZ, depth, matrix, lightStyle, backColor, topRightDarkening, bottomLeftDarkening, borderColor, borderWidth, borderDashStyle, veticalOrientation, operationType);
			}
			Point3D[] points = new Point3D[8];
			GraphicsPath path = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath) ? new GraphicsPath() : null;
			points[0] = new Point3D(position.X, position.Y, positionZ + depth);
			points[1] = new Point3D(position.X, position.Bottom, positionZ + depth);
			points[2] = new Point3D(position.Right, position.Bottom, positionZ + depth);
			points[3] = new Point3D(position.Right, position.Y, positionZ + depth);
			points[4] = new Point3D(position.X, position.Y, positionZ);
			points[5] = new Point3D(position.X, position.Bottom, positionZ);
			points[6] = new Point3D(position.Right, position.Bottom, positionZ);
			points[7] = new Point3D(position.Right, position.Y, positionZ);
			matrix.TransformPoints(points);
			if ((lightStyle == LightStyle.None) && (((borderWidth == 0) || (borderDashStyle == ChartDashStyle.NotSet)) || (borderColor == Color.Empty)))
			{
				borderColor = GetGradientColor(backColor, Color.Black, 0.5);
			}
			matrix.GetLight(backColor, out color, out color4, out color2, out color5, out color3, out color6);
			if (topRightDarkening != 0f)
			{
				if (veticalOrientation)
				{
					color3 = GetGradientColor(color3, Color.Black, (double)topRightDarkening);
				}
				else
				{
					color5 = GetGradientColor(color5, Color.Black, (double)topRightDarkening);
				}
			}
			if (bottomLeftDarkening != 0f)
			{
				if (veticalOrientation)
				{
					color6 = GetGradientColor(color6, Color.Black, (double)bottomLeftDarkening);
				}
				else
				{
					color2 = GetGradientColor(color2, Color.Black, (double)bottomLeftDarkening);
				}
			}
			SurfaceNames names = this.GetVisibleSurfacesWithPerspective(position, positionZ, depth, matrix);
			for (int i = 0; i <= 1; i++)
			{
				if ((i != 0) || (backColor.A != 0xff))
				{
					for (int j = 1; j <= 0x20; j *= 2)
					{
						SurfaceNames names2 = (SurfaceNames)j;
						if ((((depth != 0.0) || (names2 == SurfaceNames.Front)) && (((position.Width != 0.0) || (names2 == SurfaceNames.Left)) || (names2 == SurfaceNames.Right))) && (((position.Height != 0.0) || (names2 == SurfaceNames.Top)) || (names2 == SurfaceNames.Bottom)))
						{
							bool flag = (names & names2) != 0;
							if ((flag && (i == 1)) || (!flag && (i == 0)))
							{
								PointF[] tfArray = new PointF[4];
								Color color7 = backColor;
								switch (names2)
								{
									case SurfaceNames.Top:
										color7 = color3;
										tfArray[0] = new PointF(points[0].X, points[0].Y);
										tfArray[1] = new PointF(points[3].X, points[3].Y);
										tfArray[2] = new PointF(points[7].X, points[7].Y);
										tfArray[3] = new PointF(points[4].X, points[4].Y);
										break;

									case SurfaceNames.Bottom:
										color7 = color6;
										tfArray[0] = new PointF(points[1].X, points[1].Y);
										tfArray[1] = new PointF(points[2].X, points[2].Y);
										tfArray[2] = new PointF(points[6].X, points[6].Y);
										tfArray[3] = new PointF(points[5].X, points[5].Y);
										break;

									case SurfaceNames.Front:
										color7 = color;
										tfArray[0] = new PointF(points[0].X, points[0].Y);
										tfArray[1] = new PointF(points[1].X, points[1].Y);
										tfArray[2] = new PointF(points[2].X, points[2].Y);
										tfArray[3] = new PointF(points[3].X, points[3].Y);
										break;

									case SurfaceNames.Back:
										color7 = color4;
										tfArray[0] = new PointF(points[4].X, points[4].Y);
										tfArray[1] = new PointF(points[5].X, points[5].Y);
										tfArray[2] = new PointF(points[6].X, points[6].Y);
										tfArray[3] = new PointF(points[7].X, points[7].Y);
										break;

									case SurfaceNames.Left:
										color7 = color2;
										tfArray[0] = new PointF(points[0].X, points[0].Y);
										tfArray[1] = new PointF(points[1].X, points[1].Y);
										tfArray[2] = new PointF(points[5].X, points[5].Y);
										tfArray[3] = new PointF(points[4].X, points[4].Y);
										break;

									case SurfaceNames.Right:
										color7 = color5;
										tfArray[0] = new PointF(points[3].X, points[3].Y);
										tfArray[1] = new PointF(points[2].X, points[2].Y);
										tfArray[2] = new PointF(points[6].X, points[6].Y);
										tfArray[3] = new PointF(points[7].X, points[7].Y);
										break;
								}
								for (int k = 0; k < tfArray.Length; k++)
								{
									tfArray[k] = this.GetAbsolutePoint(tfArray[k]);
								}
								if ((operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement)
								{
									if ((names & names2) != 0)
									{
										using (Brush brush = new SolidBrush(color7))
										{
											this.FillPolygon(brush, tfArray);
										}
										if (((names2 == SurfaceNames.Front) && (barDrawingStyle != BarDrawingStyle.Default)) && (barDrawingStyle != BarDrawingStyle.Cylinder))
										{
											this.DrawBarStyleGradients(matrix, barDrawingStyle, position, positionZ, depth, veticalOrientation);
										}
									}
									using (System.Drawing.Pen pen = new System.Drawing.Pen(borderColor, (float)borderWidth))
									{
										pen.DashStyle = this.GetPenStyle(borderDashStyle);
										if ((lightStyle != LightStyle.None) && (((borderWidth == 0) || (borderDashStyle == ChartDashStyle.NotSet)) || (borderColor == Color.Empty)))
										{
											pen.Color = color7;
											pen.Width = 1f;
											pen.Alignment = PenAlignment.Inset;
										}
										pen.StartCap = LineCap.Round;
										pen.EndCap = LineCap.Round;
										this.DrawLine(pen, tfArray[0], tfArray[1]);
										this.DrawLine(pen, tfArray[1], tfArray[2]);
										this.DrawLine(pen, tfArray[2], tfArray[3]);
										this.DrawLine(pen, tfArray[3], tfArray[0]);
									}
								}
								if (((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath) && ((names & names2) != 0))
								{
									path.SetMarkers();
									path.AddPolygon(tfArray);
								}
							}
						}
					}
				}
			}
			return path;
		}

		internal GraphicsPath Fill3DRectangleAsCylinder(RectangleF position, float positionZ, float depth, Matrix3D matrix, LightStyle lightStyle, Color backColor, float topRightDarkening, float bottomLeftDarkening, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, bool veticalOrientation, DrawingOperationTypes operationType)
		{
			Color color;
			Color color2;
			Color color3;
			Color color4;
			Color color5;
			Color color6;
			Point3D[] points = new Point3D[8];
			GraphicsPath path = ((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath) ? new GraphicsPath() : null;
			if (veticalOrientation)
			{
				points[0] = new Point3D(position.X, position.Y, positionZ + (depth / 2f));
				points[1] = new Point3D(position.X, position.Bottom, positionZ + (depth / 2f));
				points[2] = new Point3D(position.Right, position.Bottom, positionZ + (depth / 2f));
				points[3] = new Point3D(position.Right, position.Y, positionZ + (depth / 2f));
				float x = position.X + (position.Width / 2f);
				points[4] = new Point3D(x, position.Y, positionZ + depth);
				points[5] = new Point3D(x, position.Bottom, positionZ + depth);
				points[6] = new Point3D(x, position.Bottom, positionZ);
				points[7] = new Point3D(x, position.Y, positionZ);
			}
			else
			{
				points[0] = new Point3D(position.Right, position.Y, positionZ + (depth / 2f));
				points[1] = new Point3D(position.X, position.Y, positionZ + (depth / 2f));
				points[2] = new Point3D(position.X, position.Bottom, positionZ + (depth / 2f));
				points[3] = new Point3D(position.Right, position.Bottom, positionZ + (depth / 2f));
				float y = position.Y + (position.Height / 2f);
				points[4] = new Point3D(position.Right, y, positionZ + depth);
				points[5] = new Point3D(position.X, y, positionZ + depth);
				points[6] = new Point3D(position.X, y, positionZ);
				points[7] = new Point3D(position.Right, y, positionZ);
			}
			matrix.TransformPoints(points);
			for (int i = 0; i < points.Length; i++)
			{
				points[i].PointF = this.GetAbsolutePoint(points[i].PointF);
			}
			if ((lightStyle == LightStyle.None) && (((borderWidth == 0) || (borderDashStyle == ChartDashStyle.NotSet)) || (borderColor == Color.Empty)))
			{
				borderColor = GetGradientColor(backColor, Color.Black, 0.5);
			}
			matrix.GetLight(backColor, out color, out color4, out color2, out color5, out color3, out color6);
			if (topRightDarkening != 0f)
			{
				if (veticalOrientation)
				{
					color3 = GetGradientColor(color3, Color.Black, (double)topRightDarkening);
				}
				else
				{
					color5 = GetGradientColor(color5, Color.Black, (double)topRightDarkening);
				}
			}
			if (bottomLeftDarkening != 0f)
			{
				if (veticalOrientation)
				{
					color6 = GetGradientColor(color6, Color.Black, (double)bottomLeftDarkening);
				}
				else
				{
					color2 = GetGradientColor(color2, Color.Black, (double)bottomLeftDarkening);
				}
			}
			SurfaceNames names = this.GetVisibleSurfacesWithPerspective(position, positionZ, depth, matrix);
			if ((names & SurfaceNames.Front) != SurfaceNames.Front)
			{
				names |= SurfaceNames.Front;
			}
			PointF[] tfArray = new PointF[] { points[6].PointF, points[1].PointF, points[5].PointF, points[2].PointF };
			GraphicsPath oppositeEllipseFlattenPath = new GraphicsPath();
			oppositeEllipseFlattenPath.AddClosedCurve(tfArray, 0.8f);
			oppositeEllipseFlattenPath.Flatten();
			tfArray[0] = points[7].PointF;
			tfArray[1] = points[0].PointF;
			tfArray[2] = points[4].PointF;
			tfArray[3] = points[3].PointF;
			GraphicsPath ellipseFlattenPath = new GraphicsPath();
			ellipseFlattenPath.AddClosedCurve(tfArray, 0.8f);
			ellipseFlattenPath.Flatten();
			float cylinderAngle = 90f;
			if (points[5].PointF.Y != points[4].PointF.Y)
			{
				cylinderAngle = (float)Math.Atan((double)((points[4].PointF.X - points[5].PointF.X) / (points[5].PointF.Y - points[4].PointF.Y)));
				cylinderAngle = (float)Math.Round((double)((cylinderAngle * 180f) / 3.141593f));
			}
			for (int j = 0; j <= 1; j++)
			{
				if ((j != 0) || (backColor.A != 0xff))
				{
					for (int k = 1; k <= 0x20; k *= 2)
					{
						SurfaceNames names2 = (SurfaceNames)k;
						bool flag = (names & names2) != 0;
						if ((!flag || (j != 1)) && (flag || (j != 0)))
						{
							goto Label_0A3A;
						}
						GraphicsPath resultPath = null;
						Color color7 = backColor;
						Brush brush = null;
						switch (names2)
						{
							case SurfaceNames.Right:
								if (!veticalOrientation)
								{
									color7 = color5;
									resultPath = ellipseFlattenPath;
								}
								goto Label_0931;

							case SurfaceNames.Top:
								if (veticalOrientation)
								{
									color7 = color3;
									resultPath = ellipseFlattenPath;
								}
								goto Label_0931;

							case SurfaceNames.Bottom:
								if (veticalOrientation)
								{
									color7 = color6;
									resultPath = oppositeEllipseFlattenPath;
								}
								goto Label_0931;

							case SurfaceNames.Front:
								break;

							case SurfaceNames.Left:
								if (!veticalOrientation)
								{
									color7 = color2;
									resultPath = oppositeEllipseFlattenPath;
								}
								goto Label_0931;

							default:
								goto Label_0931;
						}
						color7 = backColor;
						resultPath = new GraphicsPath();
						PointF empty = PointF.Empty;
						PointF rightSideLinePoint = PointF.Empty;
						this.AddEllipseSegment(resultPath, ellipseFlattenPath, oppositeEllipseFlattenPath, (matrix.Perspective == 0f) ? veticalOrientation : false, cylinderAngle, out empty, out rightSideLinePoint);
						resultPath.Reverse();
						PointF leftSideLinePoint = PointF.Empty;
						PointF tf4 = PointF.Empty;
						this.AddEllipseSegment(resultPath, oppositeEllipseFlattenPath, ellipseFlattenPath, (matrix.Perspective == 0f) ? veticalOrientation : false, cylinderAngle, out leftSideLinePoint, out tf4);
						resultPath.CloseAllFigures();
						this._oppLeftBottomPoint = -1;
						this._oppRigthTopPoint = -1;
						if (lightStyle != LightStyle.None)
						{
							RectangleF bounds = resultPath.GetBounds();
							if ((bounds.Height > 0f) && (bounds.Width > 0f))
							{
								Color color8 = GetGradientColor(backColor, Color.White, 0.3);
								Color color9 = GetGradientColor(backColor, Color.Black, 0.3);
								if ((!empty.IsEmpty && !rightSideLinePoint.IsEmpty) && (!leftSideLinePoint.IsEmpty && !tf4.IsEmpty))
								{
									PointF tf5 = PointF.Empty;
									tf5.X = bounds.X + (bounds.Width / 2f);
									tf5.Y = bounds.Y + (bounds.Height / 2f);
									PointF tf6 = PointF.Empty;
									double a = (cylinderAngle * 3.1415926535897931) / 180.0;
									if (cylinderAngle == 0f || cylinderAngle == 180f || cylinderAngle == -180f)
									{
										tf6.X = tf5.X + 100f;
										tf6.Y = tf5.Y;
									}
									else if (cylinderAngle == 90f || cylinderAngle == -90f)
									{
										tf6.X = tf5.X;
										tf6.Y = tf5.Y + 100f;
									}
									else if ((cylinderAngle > -45f) && (cylinderAngle < 45f))
									{
										tf6.X = tf5.X + 100f;
										tf6.Y = (float)(Math.Tan(a) * tf6.X);
										tf6.Y += tf5.Y - ((float)(Math.Tan(a) * tf5.X));
									}
									else
									{
										tf6.Y = tf5.Y + 100f;
										tf6.X = tf6.Y - (tf5.Y - ((float)(Math.Tan(a) * tf5.X)));
										tf6.X /= (float)Math.Tan(a);
									}
									PointF tf7 = GetLinesIntersection(tf5.X, tf5.Y, tf6.X, tf6.Y, empty.X, empty.Y, leftSideLinePoint.X, leftSideLinePoint.Y);
									PointF tf8 = GetLinesIntersection(tf5.X, tf5.Y, tf6.X, tf6.Y, rightSideLinePoint.X, rightSideLinePoint.Y, tf4.X, tf4.Y);
									if ((tf7.X != tf8.X) || (tf7.Y != tf8.Y))
									{
										brush = new LinearGradientBrush(tf7, tf8, color8, color9);
										ColorBlend blend = new ColorBlend(5);
										blend.Colors[0] = color9;
										blend.Colors[1] = color9;
										blend.Colors[2] = color8;
										blend.Colors[3] = color9;
										blend.Colors[4] = color9;
										blend.Positions[0] = 0f;
										blend.Positions[1] = 0f;
										blend.Positions[2] = 0.5f;
										blend.Positions[3] = 1f;
										blend.Positions[4] = 1f;
										((LinearGradientBrush)brush).InterpolationColors = blend;
									}
								}
							}
						}
					Label_0931:
						if (resultPath != null)
						{
							if ((operationType & DrawingOperationTypes.DrawElement) == DrawingOperationTypes.DrawElement)
							{
								if ((names & names2) != 0)
								{
									using (Brush brush2 = new SolidBrush(color7))
									{
										this.FillPath((brush == null) ? brush2 : brush, resultPath);
									}
								}
								using (System.Drawing.Pen pen = new System.Drawing.Pen(borderColor, (float)borderWidth))
								{
									pen.DashStyle = this.GetPenStyle(borderDashStyle);
									if ((lightStyle != LightStyle.None) && (((borderWidth == 0) || (borderDashStyle == ChartDashStyle.NotSet)) || (borderColor == Color.Empty)))
									{
										pen.Color = (brush == null) ? color7 : GetGradientColor(backColor, Color.Black, 0.3);
										pen.Width = 1f;
										pen.Alignment = PenAlignment.Inset;
									}
									pen.StartCap = LineCap.Round;
									pen.EndCap = LineCap.Round;
									pen.LineJoin = LineJoin.Bevel;
									this.DrawPath(pen, resultPath);
								}
							}
							if ((((operationType & DrawingOperationTypes.CalcElementPath) == DrawingOperationTypes.CalcElementPath) && ((names & names2) != 0)) && ((resultPath != null) && (resultPath.PointCount > 0)))
							{
								path.AddPath(resultPath, true);
								path.SetMarkers();
							}
						}
					Label_0A3A: ;
					}
				}
			}
			return path;
		}

		internal void FillDoughnutSlice(ChartArea area, DataPoint point, SolidBrush brush, System.Drawing.Pen pen, PointF firstRectPoint, PointF firstPoint, PointF secondRectPoint, PointF secondPoint, PointF threePoint, PointF fourPoint, float startAngle, float sweepAngle, bool fill, float doughnutRadius, int pointIndex)
		{
			CommonElements common = area.Common;
			doughnutRadius = 1f - (doughnutRadius / 100f);
			using (GraphicsPath path = new GraphicsPath())
			{
				RectangleF ef = new RectangleF();
				ef.X = firstRectPoint.X;
				ef.Y = firstRectPoint.Y;
				ef.Height = secondRectPoint.Y - firstRectPoint.Y;
				ef.Width = secondRectPoint.X - firstRectPoint.X;
				RectangleF ef2 = new RectangleF();
				ef2.X = ef.X + ((ef.Width * (1f - doughnutRadius)) / 2f);
				ef2.Y = ef.Y + ((ef.Height * (1f - doughnutRadius)) / 2f);
				ef2.Height = ef.Height * doughnutRadius;
				ef2.Width = ef.Width * doughnutRadius;
				double correction = ef.Height / ef.Width;
				float num2 = this.AngleCorrection(startAngle + sweepAngle, correction);
				startAngle = this.AngleCorrection(startAngle, correction);
				sweepAngle = num2 - startAngle;
				path.AddLine(fourPoint, firstPoint);
				if (ef.Height > 0f)
				{
					path.AddArc(ef.X, ef.Y, ef.Width, ef.Height, startAngle, sweepAngle);
				}
				path.AddLine(secondPoint, threePoint);
				if (ef2.Height > 0f)
				{
					path.AddArc(ef2.X, ef2.Y, ef2.Width, ef2.Height, startAngle + sweepAngle, -sweepAngle);
				}
				if (common.ProcessModePaint)
				{
					Color color;
					Color color2;
					Color color3;
					Color color4;
					Color color5;
					Color color6;
					area.matrix3D.GetLight(brush.Color, out color, out color4, out color2, out color5, out color3, out color6);
					System.Drawing.Pen pen2 = (System.Drawing.Pen)pen.Clone();
					if ((area.Area3DStyle.LightStyle == LightStyle.Realistic) && (point.BorderColor == Color.Empty))
					{
						pen2.Color = color;
					}
					if (fill)
					{
						using (Brush brush2 = new SolidBrush(color))
						{
							this.FillPath(brush2, path);
						}
					}
					if (((point.BorderColor != Color.Empty) && (point.BorderWidth > 0)) && (point.BorderDashStyle != ChartDashStyle.NotSet))
					{
						this.DrawGraphicsPath(pen2, path);
					}
				}
				if (common.ProcessModeRegions && fill)
				{
					if (point.IsCustomPropertySet("_COLLECTED_DATA_POINT"))
					{
						common.HotRegionsList.AddHotRegion(this, path, false, point.ReplaceKeywords(point.ToolTip), point.ReplaceKeywords(point.Url), point.ReplaceKeywords(point.MapAreaAttributes), point.ReplaceKeywords(point.PostBackValue), point, ChartElementType.DataPoint);
					}
					else
					{
						common.HotRegionsList.AddHotRegion(path, false, this, point, point.series.Name, pointIndex);
					}
				}
			}
		}

		internal void FillEllipse(Brush brush, RectangleF rect)
		{
			this.RenderingObject.FillEllipse(brush, rect);
		}

		internal void FillPath(Brush brush, GraphicsPath path)
		{
			if ((path != null) && (path.PointCount != 0))
			{
				this.RenderingObject.FillPath(brush, path);
			}
		}

		internal void FillPie(Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
		{
			this.RenderingObject.FillPie(brush, x, y, width, height, startAngle, sweepAngle);
		}

		internal void FillPieCurve(ChartArea area, DataPoint point, Brush brush, System.Drawing.Pen pen, PointF topFirstRectPoint, PointF topSecondRectPoint, PointF bottomFirstRectPoint, PointF bottomSecondRectPoint, PointF topFirstPoint, PointF topSecondPoint, PointF bottomFirstPoint, PointF bottomSecondPoint, float startAngle, float sweepAngle, int pointIndex)
		{
			CommonElements common = area.Common;
			using (GraphicsPath path = new GraphicsPath())
			{
				RectangleF ef = new RectangleF();
				ef.X = topFirstRectPoint.X;
				ef.Y = topFirstRectPoint.Y;
				ef.Height = topSecondRectPoint.Y - topFirstRectPoint.Y;
				ef.Width = topSecondRectPoint.X - topFirstRectPoint.X;
				RectangleF ef2 = new RectangleF();
				ef2.X = bottomFirstRectPoint.X;
				ef2.Y = bottomFirstRectPoint.Y;
				ef2.Height = bottomSecondRectPoint.Y - bottomFirstRectPoint.Y;
				ef2.Width = bottomSecondRectPoint.X - bottomFirstRectPoint.X;
				double correction = ef.Height / ef.Width;
				float num2 = this.AngleCorrection(startAngle + sweepAngle, correction);
				startAngle = this.AngleCorrection(startAngle, correction);
				sweepAngle = num2 - startAngle;
				path.AddLine(topFirstPoint, bottomFirstPoint);
				if (ef2.Height <= 0f)
				{
					path.AddLine(bottomFirstPoint.X, bottomFirstPoint.Y, bottomSecondPoint.X, bottomSecondPoint.Y);
				}
				else
				{
					path.AddArc(ef2.X, ef2.Y, ef2.Width, ef2.Height, startAngle, sweepAngle);
				}
				path.AddLine(bottomSecondPoint, topSecondPoint);
				if (ef.Height <= 0f)
				{
					path.AddLine(topFirstPoint.X, topFirstPoint.Y, topSecondPoint.X, topSecondPoint.Y);
				}
				else
				{
					path.AddArc(ef.X, ef.Y, ef.Width, ef.Height, startAngle + sweepAngle, -sweepAngle);
				}
				if (common.ProcessModePaint)
				{
					this.FillPath(brush, path);
					if (((point.BorderColor != Color.Empty) && (point.BorderWidth > 0)) && (point.BorderDashStyle != ChartDashStyle.NotSet))
					{
						this.DrawGraphicsPath(pen, path);
					}
				}
				if (common.ProcessModeRegions)
				{
					if (point.IsCustomPropertySet("_COLLECTED_DATA_POINT"))
					{
						common.HotRegionsList.AddHotRegion(this, path, false, point.ReplaceKeywords(point.ToolTip), point.ReplaceKeywords(point.Url), point.ReplaceKeywords(point.MapAreaAttributes), point.ReplaceKeywords(point.PostBackValue), point, ChartElementType.DataPoint);
					}
					else
					{
						common.HotRegionsList.AddHotRegion(path, false, this, point, point.series.Name, pointIndex);
					}
				}
			}
		}

		internal void FillPieSides(ChartArea area, float inclination, float startAngle, float sweepAngle, PointF[] points, SolidBrush brush, System.Drawing.Pen pen, bool doughnut)
		{
			GraphicsPath path = new GraphicsPath();
			PointF tf = points[8];
			PointF tf2 = points[9];
			PointF tf3 = points[4];
			PointF tf4 = points[6];
			PointF tf5 = points[5];
			PointF tf6 = points[7];
			PointF empty = PointF.Empty;
			PointF tf8 = PointF.Empty;
			PointF tf9 = PointF.Empty;
			PointF tf10 = PointF.Empty;
			if (doughnut)
			{
				empty = points[0x15];
				tf8 = points[0x17];
				tf9 = points[0x16];
				tf10 = points[0x18];
			}
			bool flag = false;
			bool flag2 = false;
			float num = startAngle + sweepAngle;
			if (inclination > 0f)
			{
				if (((startAngle > -90f) && (startAngle < 90f)) || ((startAngle > 270f) && (startAngle < 450f)))
				{
					flag = true;
				}
				if ((((num >= -180f) && (num < -90f)) || ((num > 90f) && (num < 270f))) || ((num > 450f) && (num <= 540f)))
				{
					flag2 = true;
				}
			}
			else
			{
				if ((((startAngle >= -180f) && (startAngle < -90f)) || ((startAngle > 90f) && (startAngle < 270f))) || ((startAngle > 450f) && (startAngle <= 540f)))
				{
					flag = true;
				}
				if (((num > -90f) && (num < 90f)) || ((num > 270f) && (num < 450f)))
				{
					flag2 = true;
				}
			}
			if (flag)
			{
				using (path = new GraphicsPath())
				{
					Color color;
					Color color2;
					Color color3;
					Color color4;
					Color color5;
					Color color6;
					Color color7;
					if (doughnut)
					{
						path.AddLine(empty, tf3);
						path.AddLine(tf3, tf4);
						path.AddLine(tf4, tf8);
						path.AddLine(tf8, empty);
					}
					else
					{
						path.AddLine(tf, tf3);
						path.AddLine(tf3, tf4);
						path.AddLine(tf4, tf2);
						path.AddLine(tf2, tf);
					}
					area.matrix3D.GetLight(brush.Color, out color, out color4, out color2, out color5, out color3, out color6);
					if (area.Area3DStyle.Inclination < 0)
					{
						color7 = color6;
					}
					else
					{
						color7 = color3;
					}
					using (Brush brush2 = new SolidBrush(color7))
					{
						this.FillPath(brush2, path);
					}
					this.DrawGraphicsPath(pen, path);
				}
			}
			if (flag2)
			{
				using (path = new GraphicsPath())
				{
					Color color8;
					Color color9;
					Color color10;
					Color color11;
					Color color12;
					Color color13;
					Color color14;
					if (doughnut)
					{
						path.AddLine(tf9, tf5);
						path.AddLine(tf5, tf6);
						path.AddLine(tf6, tf10);
						path.AddLine(tf10, tf9);
					}
					else
					{
						path.AddLine(tf, tf5);
						path.AddLine(tf5, tf6);
						path.AddLine(tf6, tf2);
						path.AddLine(tf2, tf);
					}
					area.matrix3D.GetLight(brush.Color, out color8, out color11, out color9, out color12, out color10, out color13);
					if (area.Area3DStyle.Inclination < 0)
					{
						color14 = color13;
					}
					else
					{
						color14 = color10;
					}
					using (Brush brush3 = new SolidBrush(color14))
					{
						this.FillPath(brush3, path);
					}
					this.DrawGraphicsPath(pen, path);
				}
			}
		}

		internal void FillPieSlice(ChartArea area, DataPoint point, SolidBrush brush, System.Drawing.Pen pen, PointF firstRectPoint, PointF firstPoint, PointF secondRectPoint, PointF secondPoint, PointF center, float startAngle, float sweepAngle, bool fill, int pointIndex)
		{
			CommonElements common = area.Common;
			using (GraphicsPath path = new GraphicsPath())
			{
				RectangleF ef = new RectangleF();
				ef.X = firstRectPoint.X;
				ef.Y = firstRectPoint.Y;
				ef.Height = secondRectPoint.Y - firstRectPoint.Y;
				ef.Width = secondRectPoint.X - firstRectPoint.X;
				double correction = ef.Height / ef.Width;
				float num2 = this.AngleCorrection(startAngle + sweepAngle, correction);
				startAngle = this.AngleCorrection(startAngle, correction);
				sweepAngle = num2 - startAngle;
				path.AddLine(center, firstPoint);
				if (ef.Height > 0f)
				{
					path.AddArc(ef.X, ef.Y, ef.Width, ef.Height, startAngle, sweepAngle);
				}
				path.AddLine(secondPoint, center);
				if (common.ProcessModePaint)
				{
					Color color;
					Color color2;
					Color color3;
					Color color4;
					Color color5;
					Color color6;
					area.matrix3D.GetLight(brush.Color, out color, out color4, out color2, out color5, out color3, out color6);
					System.Drawing.Pen pen2 = (System.Drawing.Pen)pen.Clone();
					if ((area.Area3DStyle.LightStyle == LightStyle.Realistic) && (point.BorderColor == Color.Empty))
					{
						pen2.Color = color;
					}
					if (fill)
					{
						using (Brush brush2 = new SolidBrush(color))
						{
							this.FillPath(brush2, path);
						}
					}
					if (((point.BorderColor != Color.Empty) && (point.BorderWidth > 0)) && (point.BorderDashStyle != ChartDashStyle.NotSet))
					{
						this.DrawGraphicsPath(pen2, path);
					}
				}
				if (common.ProcessModeRegions && fill)
				{
					if (point.IsCustomPropertySet("_COLLECTED_DATA_POINT"))
					{
						common.HotRegionsList.AddHotRegion(this, path, false, point.ReplaceKeywords(point.ToolTip), point.ReplaceKeywords(point.Url), point.ReplaceKeywords(point.MapAreaAttributes), point.ReplaceKeywords(point.PostBackValue), point, ChartElementType.DataPoint);
					}
					else
					{
						common.HotRegionsList.AddHotRegion(path, false, this, point, point.series.Name, pointIndex);
					}
				}
			}
		}

		internal void FillPolygon(Brush brush, PointF[] points)
		{
			this.RenderingObject.FillPolygon(brush, points);
		}

		internal void FillRectangle(Brush brush, RectangleF rect)
		{
			this.RenderingObject.FillRectangle(brush, rect);
		}

		internal void FillRectangle(Brush brush, float x, float y, float width, float height)
		{
			this.RenderingObject.FillRectangle(brush, x, y, width, height);
		}

		internal void FillRectangleAbs(RectangleF rect, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageWrapMode, Color backImageTransparentColor, ChartImageAlignmentStyle backImageAlign, GradientStyle backGradientStyle, Color backSecondaryColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, PenAlignment penAlignment)
		{
			Brush brush = null;
			Brush brush2 = null;
			System.Drawing.Drawing2D.SmoothingMode smoothingMode = this.SmoothingMode;
			this.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
			if (backColor.IsEmpty)
			{
				backColor = Color.White;
			}
			if (backSecondaryColor.IsEmpty)
			{
				backSecondaryColor = Color.White;
			}
			if (borderColor.IsEmpty)
			{
				borderColor = Color.White;
				borderWidth = 0;
			}
			this._pen.Color = borderColor;
			this._pen.Width = borderWidth;
			this._pen.Alignment = penAlignment;
			this._pen.DashStyle = this.GetPenStyle(borderDashStyle);
			if (backGradientStyle == GradientStyle.None)
			{
				this._solidBrush.Color = backColor;
				brush = this._solidBrush;
			}
			else
			{
				brush = this.GetGradientBrush(rect, backColor, backSecondaryColor, backGradientStyle);
			}
			if (backHatchStyle != ChartHatchStyle.None)
			{
				brush = this.GetHatchBrush(backHatchStyle, backColor, backSecondaryColor);
			}
			if (((backImage.Length > 0) && (backImageWrapMode != ChartImageWrapMode.Unscaled)) && (backImageWrapMode != ChartImageWrapMode.Scaled))
			{
				brush2 = brush;
				brush = this.GetTextureBrush(backImage, backImageTransparentColor, backImageWrapMode, backColor);
			}
			RectangleF ef = new RectangleF(rect.X + borderWidth, rect.Y + borderWidth, rect.Width - (borderWidth * 2), rect.Height - (borderWidth * 2));
			ef.Width++;
			ef.Height++;
			if ((backImage.Length > 0) && ((backImageWrapMode == ChartImageWrapMode.Unscaled) || (backImageWrapMode == ChartImageWrapMode.Scaled)))
			{
				Image image = this._common.ImageLoader.LoadImage(backImage);
				ImageAttributes imageAttr = new ImageAttributes();
				if (backImageTransparentColor != Color.Empty)
				{
					imageAttr.SetColorKey(backImageTransparentColor, backImageTransparentColor, ColorAdjustType.Default);
				}
				RectangleF ef2 = new RectangleF();
				ef2.X = ef.X;
				ef2.Y = ef.Y;
				ef2.Width = ef.Width;
				ef2.Height = ef.Height;
				if (backImageWrapMode == ChartImageWrapMode.Unscaled)
				{
					SizeF size = new SizeF();
					ImageLoader.GetAdjustedImageSize(image, this.Graphics, ref size);
					ef2.Width = size.Width;
					ef2.Height = size.Height;
					if (ef2.Width < ef.Width)
					{
						if (((backImageAlign == ChartImageAlignmentStyle.BottomRight) || (backImageAlign == ChartImageAlignmentStyle.Right)) || (backImageAlign == ChartImageAlignmentStyle.TopRight))
						{
							ef2.X = ef.Right - ef2.Width;
						}
						else if (((backImageAlign == ChartImageAlignmentStyle.Bottom) || (backImageAlign == ChartImageAlignmentStyle.Center)) || (backImageAlign == ChartImageAlignmentStyle.Top))
						{
							ef2.X = ef.X + ((ef.Width - ef2.Width) / 2f);
						}
					}
					if (ef2.Height < ef.Height)
					{
						if (((backImageAlign == ChartImageAlignmentStyle.BottomRight) || (backImageAlign == ChartImageAlignmentStyle.Bottom)) || (backImageAlign == ChartImageAlignmentStyle.BottomLeft))
						{
							ef2.Y = ef.Bottom - ef2.Height;
						}
						else if (((backImageAlign == ChartImageAlignmentStyle.Left) || (backImageAlign == ChartImageAlignmentStyle.Center)) || (backImageAlign == ChartImageAlignmentStyle.Right))
						{
							ef2.Y = ef.Y + ((ef.Height - ef2.Height) / 2f);
						}
					}
				}
				this.FillRectangle(brush, rect.X, rect.Y, rect.Width + 1f, rect.Height + 1f);
				this.DrawImage(image, new Rectangle((int)Math.Round((double)ef2.X), (int)Math.Round((double)ef2.Y), (int)Math.Round((double)ef2.Width), (int)Math.Round((double)ef2.Height)), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, imageAttr);
			}
			else
			{
				if ((brush2 != null) && (backImageTransparentColor != Color.Empty))
				{
					this.FillRectangle(brush2, rect.X, rect.Y, rect.Width + 1f, rect.Height + 1f);
				}
				this.FillRectangle(brush, rect.X, rect.Y, rect.Width + 1f, rect.Height + 1f);
			}
			if (borderDashStyle != ChartDashStyle.NotSet)
			{
				if (borderWidth > 1)
				{
					this.DrawRectangle(this._pen, rect.X, rect.Y, rect.Width + 1f, rect.Height + 1f);
				}
				else if (borderWidth == 1)
				{
					this.DrawRectangle(this._pen, rect.X, rect.Y, rect.Width, rect.Height);
				}
			}
			if (backGradientStyle != GradientStyle.None)
			{
				brush.Dispose();
			}
			if (((backImage.Length > 0) && (backImageWrapMode != ChartImageWrapMode.Unscaled)) && (backImageWrapMode != ChartImageWrapMode.Scaled))
			{
				brush.Dispose();
			}
			if (backHatchStyle != ChartHatchStyle.None)
			{
				brush.Dispose();
			}
			this.SmoothingMode = smoothingMode;
		}

		internal void FillRectangleRel(RectangleF rectF, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageWrapMode, Color backImageTransparentColor, ChartImageAlignmentStyle backImageAlign, GradientStyle backGradientStyle, Color backSecondaryColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, Color shadowColor, int shadowOffset, PenAlignment penAlignment)
		{
			this.FillRectangleRel(rectF, backColor, backHatchStyle, backImage, backImageWrapMode, backImageTransparentColor, backImageAlign, backGradientStyle, backSecondaryColor, borderColor, borderWidth, borderDashStyle, shadowColor, shadowOffset, penAlignment, false, 0, false, BarDrawingStyle.Default, true);
		}

		internal void FillRectangleRel(RectangleF rectF, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageWrapMode, Color backImageTransparentColor, ChartImageAlignmentStyle backImageAlign, GradientStyle backGradientStyle, Color backSecondaryColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, Color shadowColor, int shadowOffset, PenAlignment penAlignment, BarDrawingStyle barDrawingStyle, bool isVertical)
		{
			this.FillRectangleRel(rectF, backColor, backHatchStyle, backImage, backImageWrapMode, backImageTransparentColor, backImageAlign, backGradientStyle, backSecondaryColor, borderColor, borderWidth, borderDashStyle, shadowColor, shadowOffset, penAlignment, false, 0, false, barDrawingStyle, isVertical);
		}

		internal void FillRectangleRel(RectangleF rectF, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageWrapMode, Color backImageTransparentColor, ChartImageAlignmentStyle backImageAlign, GradientStyle backGradientStyle, Color backSecondaryColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, Color shadowColor, int shadowOffset, PenAlignment penAlignment, bool circular, int circularSectorsCount, bool circle3D)
		{
			this.FillRectangleRel(rectF, backColor, backHatchStyle, backImage, backImageWrapMode, backImageTransparentColor, backImageAlign, backGradientStyle, backSecondaryColor, borderColor, borderWidth, borderDashStyle, shadowColor, shadowOffset, penAlignment, circular, circularSectorsCount, circle3D, BarDrawingStyle.Default, true);
		}

		internal void FillRectangleRel(RectangleF rectF, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageWrapMode, Color backImageTransparentColor, ChartImageAlignmentStyle backImageAlign, GradientStyle backGradientStyle, Color backSecondaryColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle, Color shadowColor, int shadowOffset, PenAlignment penAlignment, bool circular, int circularSectorsCount, bool circle3D, BarDrawingStyle barDrawingStyle, bool isVertical)
		{
			Brush brush = null;
			Brush brush2 = null;
			RectangleF ef2;
			System.Drawing.Drawing2D.SmoothingMode smoothingMode = this.SmoothingMode;
			if (!circular)
			{
				this.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
			}
			if (backColor.IsEmpty)
			{
				backColor = Color.White;
			}
			if (backSecondaryColor.IsEmpty)
			{
				backSecondaryColor = Color.White;
			}
			if (borderColor.IsEmpty || (borderDashStyle == ChartDashStyle.NotSet))
			{
				borderWidth = 0;
			}
			RectangleF absoluteRectangle = this.GetAbsoluteRectangle(rectF);
			if ((absoluteRectangle.Width < 1f) && (absoluteRectangle.Width > 0f))
			{
				absoluteRectangle.Width = 1f;
			}
			if ((absoluteRectangle.Height < 1f) && (absoluteRectangle.Height > 0f))
			{
				absoluteRectangle.Height = 1f;
			}
			absoluteRectangle = this.Round(absoluteRectangle);
			if ((penAlignment == PenAlignment.Inset) && (borderWidth > 0))
			{
				if ((this.ActiveRenderingType == RenderingType.Svg) || this.IsMetafile)
				{
					ef2 = new RectangleF(absoluteRectangle.X, absoluteRectangle.Y, absoluteRectangle.Width, absoluteRectangle.Height);
				}
				else if ((this.Graphics.Transform.Elements[0] != 1f) || (this.Graphics.Transform.Elements[3] != 1f))
				{
					ef2 = new RectangleF(absoluteRectangle.X, absoluteRectangle.Y, absoluteRectangle.Width, absoluteRectangle.Height);
				}
				else
				{
					ef2 = new RectangleF(absoluteRectangle.X + borderWidth, absoluteRectangle.Y + borderWidth, (absoluteRectangle.Width - (borderWidth * 2f)) + 1f, (absoluteRectangle.Height - (borderWidth * 2f)) + 1f);
				}
			}
			else
			{
				ef2 = absoluteRectangle;
			}
			if (ef2.Width > (2f * this._width))
			{
				ef2.Width = 2f * this._width;
			}
			if (ef2.Height > (2f * this._height))
			{
				ef2.Height = 2f * this._height;
			}
			if (((backImage.Length > 0) && (backImageWrapMode != ChartImageWrapMode.Unscaled)) && (backImageWrapMode != ChartImageWrapMode.Scaled))
			{
				brush2 = brush;
				brush = this.GetTextureBrush(backImage, backImageTransparentColor, backImageWrapMode, backColor);
			}
			else if (backHatchStyle != ChartHatchStyle.None)
			{
				brush = this.GetHatchBrush(backHatchStyle, backColor, backSecondaryColor);
			}
			else if (backGradientStyle != GradientStyle.None)
			{
				brush = this.GetGradientBrush(absoluteRectangle, backColor, backSecondaryColor, backGradientStyle);
			}
			else if ((backColor == Color.Empty) || (backColor == Color.Transparent))
			{
				brush = null;
			}
			else
			{
				brush = new SolidBrush(backColor);
			}
			this.FillRectangleShadowAbs(absoluteRectangle, shadowColor, (float)shadowOffset, backColor, circular, circularSectorsCount);
			if ((backImage.Length > 0) && ((backImageWrapMode == ChartImageWrapMode.Unscaled) || (backImageWrapMode == ChartImageWrapMode.Scaled)))
			{
				Image image = this._common.ImageLoader.LoadImage(backImage);
				ImageAttributes imageAttrs = new ImageAttributes();
				if (backImageTransparentColor != Color.Empty)
				{
					imageAttrs.SetColorKey(backImageTransparentColor, backImageTransparentColor, ColorAdjustType.Default);
				}
				RectangleF ef3 = new RectangleF();
				ef3.X = ef2.X;
				ef3.Y = ef2.Y;
				ef3.Width = ef2.Width;
				ef3.Height = ef2.Height;
				SizeF size = new SizeF();
				if (backImageWrapMode == ChartImageWrapMode.Unscaled)
				{
					ImageLoader.GetAdjustedImageSize(image, this.Graphics, ref size);
					ef3.Width = Math.Min(ef2.Width, size.Width);
					ef3.Height = Math.Min(ef2.Height, size.Height);
					if (ef3.Width < ef2.Width)
					{
						if (((backImageAlign == ChartImageAlignmentStyle.BottomRight) || (backImageAlign == ChartImageAlignmentStyle.Right)) || (backImageAlign == ChartImageAlignmentStyle.TopRight))
						{
							ef3.X = ef2.Right - ef3.Width;
						}
						else if (((backImageAlign == ChartImageAlignmentStyle.Bottom) || (backImageAlign == ChartImageAlignmentStyle.Center)) || (backImageAlign == ChartImageAlignmentStyle.Top))
						{
							ef3.X = ef2.X + ((ef2.Width - ef3.Width) / 2f);
						}
					}
					if (ef3.Height < ef2.Height)
					{
						if (((backImageAlign == ChartImageAlignmentStyle.BottomRight) || (backImageAlign == ChartImageAlignmentStyle.Bottom)) || (backImageAlign == ChartImageAlignmentStyle.BottomLeft))
						{
							ef3.Y = ef2.Bottom - ef3.Height;
						}
						else if (((backImageAlign == ChartImageAlignmentStyle.Left) || (backImageAlign == ChartImageAlignmentStyle.Center)) || (backImageAlign == ChartImageAlignmentStyle.Right))
						{
							ef3.Y = ef2.Y + ((ef2.Height - ef3.Height) / 2f);
						}
					}
				}
				if (brush != null)
				{
					if (circular)
					{
						this.DrawCircleAbs(null, brush, ef2, circularSectorsCount, circle3D);
					}
					else
					{
						this.FillRectangle(brush, ef2);
					}
				}
				this.DrawImage(image, new Rectangle((int)Math.Round((double)ef3.X), (int)Math.Round((double)ef3.Y), (int)Math.Round((double)ef3.Width), (int)Math.Round((double)ef3.Height)), 0f, 0f, (backImageWrapMode == ChartImageWrapMode.Unscaled) ? ((ef3.Width * image.Width) / size.Width) : ((float)image.Width), (backImageWrapMode == ChartImageWrapMode.Unscaled) ? ((ef3.Height * image.Height) / size.Height) : ((float)image.Height), GraphicsUnit.Pixel, imageAttrs);
			}
			else
			{
				if ((brush2 != null) && (backImageTransparentColor != Color.Empty))
				{
					if (circular)
					{
						this.DrawCircleAbs(null, brush2, ef2, circularSectorsCount, circle3D);
					}
					else
					{
						this.FillRectangle(brush2, ef2);
					}
				}
				if (brush != null)
				{
					if (circular)
					{
						this.DrawCircleAbs(null, brush, ef2, circularSectorsCount, circle3D);
					}
					else
					{
						this.FillRectangle(brush, ef2);
					}
				}
			}
			this.DrawRectangleBarStyle(barDrawingStyle, isVertical, ef2);
			if ((borderWidth > 0) && (borderDashStyle != ChartDashStyle.NotSet))
			{
				if (this._pen.Color != borderColor)
				{
					this._pen.Color = borderColor;
				}
				if (this._pen.Width != borderWidth)
				{
					this._pen.Width = borderWidth;
				}
				if (this._pen.Alignment != penAlignment)
				{
					this._pen.Alignment = penAlignment;
				}
				if (this._pen.DashStyle != this.GetPenStyle(borderDashStyle))
				{
					this._pen.DashStyle = this.GetPenStyle(borderDashStyle);
				}
				if (circular)
				{
					this.DrawCircleAbs(this._pen, null, absoluteRectangle, circularSectorsCount, false);
				}
				else
				{
					if ((this._pen.Alignment == PenAlignment.Inset) && (this._pen.Width > 1f))
					{
						absoluteRectangle.Width++;
						absoluteRectangle.Height++;
					}
					this.DrawRectangle(this._pen, absoluteRectangle.X, absoluteRectangle.Y, absoluteRectangle.Width, absoluteRectangle.Height);
				}
			}
			if (brush != null)
			{
				brush.Dispose();
			}
			this.SmoothingMode = smoothingMode;
		}

		internal void FillRectangleShadowAbs(RectangleF rect, Color shadowColor, float shadowOffset, Color backColor)
		{
			this.FillRectangleShadowAbs(rect, shadowColor, shadowOffset, backColor, false, 0);
		}

		internal void FillRectangleShadowAbs(RectangleF rect, Color shadowColor, float shadowOffset, Color backColor, bool circular, int circularSectorsCount)
		{
			if (((rect.Height == 0f) || (rect.Width == 0f)) || (shadowOffset == 0f))
			{
				return;
			}
			if ((shadowOffset == 0f) || (shadowColor == Color.Empty))
			{
				return;
			}
			bool flag = false;
			Region clip = null;
			if (!circular && (backColor == Color.Transparent))
			{
				flag = true;
				clip = this.Clip;
				Region region2 = new Region();
				region2.MakeInfinite();
				region2.Xor(rect);
				this.Clip = region2;
			}
			if (!this.softShadows || (circularSectorsCount > 2))
			{
				RectangleF position = RectangleF.Empty;
				RectangleF ef = this.Round(rect);
				using (SolidBrush brush = new SolidBrush((shadowColor.A != 0xff) ? shadowColor : Color.FromArgb(backColor.A / 2, shadowColor)))
				{
					position.X = ef.X + shadowOffset;
					position.Y = ef.Y + shadowOffset;
					position.Width = ef.Width;
					position.Height = ef.Height;
					if (circular)
					{
						this.DrawCircleAbs(null, brush, position, circularSectorsCount, false);
					}
					else
					{
						this.FillRectangle(brush, position);
					}
					goto Label_061F;
				}
			}
			RectangleF empty = RectangleF.Empty;
			RectangleF ef3 = this.Round(rect);
			empty.X = (ef3.X + shadowOffset) - 1f;
			empty.Y = (ef3.Y + shadowOffset) - 1f;
			empty.Width = ef3.Width + 2f;
			empty.Height = ef3.Height + 2f;
			float num = shadowOffset * 0.7f;
			num = Math.Max(num, 2f);
			num = Math.Min(num, empty.Width / 4f);
			num = Math.Min(num, empty.Height / 4f);
			num = (float)Math.Ceiling((double)num);
			if (circular)
			{
				num = empty.Width / 2f;
			}
			GraphicsPath path = new GraphicsPath();
			if (circular && (empty.Width != empty.Height))
			{
				float num2 = empty.Width / 2f;
				float num3 = empty.Height / 2f;
				path.AddLine(empty.X + num2, empty.Y, empty.Right - num2, empty.Y);
				path.AddArc(empty.Right - (2f * num2), empty.Y, 2f * num2, 2f * num3, 270f, 90f);
				path.AddLine(empty.Right, empty.Y + num3, empty.Right, empty.Bottom - num3);
				path.AddArc((float)(empty.Right - (2f * num2)), (float)(empty.Bottom - (2f * num3)), (float)(2f * num2), (float)(2f * num3), 0f, 90f);
				path.AddLine(empty.Right - num2, empty.Bottom, empty.X + num2, empty.Bottom);
				path.AddArc(empty.X, empty.Bottom - (2f * num3), 2f * num2, 2f * num3, 90f, 90f);
				path.AddLine(empty.X, empty.Bottom - num3, empty.X, empty.Y + num3);
				path.AddArc(empty.X, empty.Y, 2f * num2, 2f * num3, 180f, 90f);
			}
			else
			{
				path.AddLine(empty.X + num, empty.Y, empty.Right - num, empty.Y);
				path.AddArc(empty.Right - (2f * num), empty.Y, 2f * num, 2f * num, 270f, 90f);
				path.AddLine(empty.Right, empty.Y + num, empty.Right, empty.Bottom - num);
				path.AddArc((float)(empty.Right - (2f * num)), (float)(empty.Bottom - (2f * num)), (float)(2f * num), (float)(2f * num), 0f, 90f);
				path.AddLine(empty.Right - num, empty.Bottom, empty.X + num, empty.Bottom);
				path.AddArc(empty.X, empty.Bottom - (2f * num), 2f * num, 2f * num, 90f, 90f);
				path.AddLine(empty.X, empty.Bottom - num, empty.X, empty.Y + num);
				path.AddArc(empty.X, empty.Y, 2f * num, 2f * num, 180f, 90f);
			}
			PathGradientBrush brush2 = new PathGradientBrush(path);
			brush2.CenterColor = shadowColor;
			Color[] colorArray = new Color[] { Color.Transparent };
			brush2.SurroundColors = colorArray;
			brush2.CenterPoint = new PointF(empty.X + (empty.Width / 2f), empty.Y + (empty.Height / 2f));
			PointF tf = new PointF(1f - ((2f * shadowOffset) / empty.Width), 1f - ((2f * shadowOffset) / empty.Height));
			if (tf.X < 0f)
			{
				tf.X = 0f;
			}
			if (tf.Y < 0f)
			{
				tf.Y = 0f;
			}
			brush2.FocusScales = tf;
			this.FillPath(brush2, path);
		Label_061F:
			if (flag)
			{
				Region region3 = this.Clip;
				this.Clip = clip;
				region3.Dispose();
			}
		}

		internal void FillRegion(Brush brush, Region region)
		{
			this.RenderingObject.FillRegion(brush, region);
		}

		internal static DataPoint3D FindPointByIndex(ArrayList points, int index, DataPoint3D neighborDataPoint, ref int neighborPointIndex)
		{
			if (neighborPointIndex != -2147483648)
			{
				if (neighborPointIndex < (points.Count - 2))
				{
					DataPoint3D pointd = (DataPoint3D)points[neighborPointIndex + 1];
					if ((pointd.index == index) && ((neighborDataPoint == null) || (string.Compare(neighborDataPoint.dataPoint.series.Name, pointd.dataPoint.series.Name, StringComparison.Ordinal) == 0)))
					{
						neighborPointIndex++;
						return pointd;
					}
				}
				if (neighborPointIndex > 0)
				{
					DataPoint3D pointd2 = (DataPoint3D)points[neighborPointIndex - 1];
					if ((pointd2.index == index) && ((neighborDataPoint == null) || (string.Compare(neighborDataPoint.dataPoint.series.Name, pointd2.dataPoint.series.Name, StringComparison.Ordinal) == 0)))
					{
						neighborPointIndex--;
						return pointd2;
					}
				}
			}
			neighborPointIndex = 0;
			foreach (DataPoint3D pointd3 in points)
			{
				if (pointd3.index == index)
				{
					if ((neighborDataPoint == null) || (string.Compare(neighborDataPoint.dataPoint.series.Name, pointd3.dataPoint.series.Name, StringComparison.Ordinal) == 0))
					{
						return pointd3;
					}
					neighborPointIndex++;
					continue;
				}
				neighborPointIndex++;
			}
			return null;
		}

		public PointF GetAbsolutePoint(PointF point)
		{
			PointF empty = PointF.Empty;
			empty.X = (point.X * (this._width - 1)) / 100f;
			empty.Y = (point.Y * (this._height - 1)) / 100f;
			return empty;
		}

		public RectangleF GetAbsoluteRectangle(RectangleF rectangle)
		{
			RectangleF empty = RectangleF.Empty;
			empty.X = (rectangle.X * (this._width - 1)) / 100f;
			empty.Y = (rectangle.Y * (this._height - 1)) / 100f;
			empty.Width = (rectangle.Width * (this._width - 1)) / 100f;
			empty.Height = (rectangle.Height * (this._height - 1)) / 100f;
			return empty;
		}

		public SizeF GetAbsoluteSize(SizeF size)
		{
			SizeF empty = SizeF.Empty;
			empty.Width = (size.Width * (this._width - 1)) / 100f;
			empty.Height = (size.Height * (this._height - 1)) / 100f;
			return empty;
		}

		private PointF[] GetArrowShape(PointF position, ArrowOrientation orientation, double shift, double size, AxisArrowStyle type, ref PointF endPoint)
		{
			double num;
			PointF[] tfArray = new PointF[3];
			switch (orientation)
			{
				case ArrowOrientation.Left:
					size = this.GetAbsoluteSize(new SizeF((float)size, (float)size)).Width;
					shift = this.GetAbsoluteSize(new SizeF((float)shift, (float)shift)).Width;
					if (type != AxisArrowStyle.SharpTriangle)
					{
						num = size * 2.0;
					}
					else
					{
						num = size * 4.0;
					}
					tfArray[0].Y = position.Y - ((float)size);
					tfArray[0].X = position.X - ((float)shift);
					tfArray[1].Y = position.Y + ((float)size);
					tfArray[1].X = position.X - ((float)shift);
					tfArray[2].Y = position.Y;
					tfArray[2].X = (position.X - ((float)shift)) - ((float)num);
					endPoint.Y = position.Y;
					if ((type == AxisArrowStyle.SharpTriangle) || (type == AxisArrowStyle.Triangle))
					{
						endPoint.X = tfArray[1].X;
						return tfArray;
					}
					endPoint.X = tfArray[2].X;
					return tfArray;

				case ArrowOrientation.Right:
					size = this.GetAbsoluteSize(new SizeF((float)size, (float)size)).Width;
					shift = this.GetAbsoluteSize(new SizeF((float)shift, (float)shift)).Width;
					if (type != AxisArrowStyle.SharpTriangle)
					{
						num = size * 2.0;
					}
					else
					{
						num = size * 4.0;
					}
					tfArray[0].Y = position.Y - ((float)size);
					tfArray[0].X = position.X + ((float)shift);
					tfArray[1].Y = position.Y + ((float)size);
					tfArray[1].X = position.X + ((float)shift);
					tfArray[2].Y = position.Y;
					tfArray[2].X = (position.X + ((float)shift)) + ((float)num);
					endPoint.Y = position.Y;
					if ((type == AxisArrowStyle.SharpTriangle) || (type == AxisArrowStyle.Triangle))
					{
						endPoint.X = tfArray[1].X;
						return tfArray;
					}
					endPoint.X = tfArray[2].X;
					return tfArray;

				case ArrowOrientation.Top:
					size = this.GetAbsoluteSize(new SizeF((float)size, (float)size)).Width;
					shift = this.GetAbsoluteSize(new SizeF((float)shift, (float)shift)).Height;
					if (type != AxisArrowStyle.SharpTriangle)
					{
						num = size * 2.0;
						break;
					}
					num = size * 4.0;
					break;

				case ArrowOrientation.Bottom:
					size = this.GetAbsoluteSize(new SizeF((float)size, (float)size)).Width;
					shift = this.GetAbsoluteSize(new SizeF((float)shift, (float)shift)).Height;
					if (type != AxisArrowStyle.SharpTriangle)
					{
						num = size * 2.0;
					}
					else
					{
						num = size * 4.0;
					}
					tfArray[0].X = position.X - ((float)size);
					tfArray[0].Y = position.Y + ((float)shift);
					tfArray[1].X = position.X + ((float)size);
					tfArray[1].Y = position.Y + ((float)shift);
					tfArray[2].X = position.X;
					tfArray[2].Y = (position.Y + ((float)shift)) + ((float)num);
					endPoint.X = position.X;
					if ((type == AxisArrowStyle.SharpTriangle) || (type == AxisArrowStyle.Triangle))
					{
						endPoint.Y = tfArray[1].Y;
						return tfArray;
					}
					endPoint.Y = tfArray[2].Y;
					return tfArray;

				default:
					return tfArray;
			}
			tfArray[0].X = position.X - ((float)size);
			tfArray[0].Y = position.Y - ((float)shift);
			tfArray[1].X = position.X + ((float)size);
			tfArray[1].Y = position.Y - ((float)shift);
			tfArray[2].X = position.X;
			tfArray[2].Y = (position.Y - ((float)shift)) - ((float)num);
			endPoint.X = position.X;
			if ((type == AxisArrowStyle.SharpTriangle) || (type == AxisArrowStyle.Triangle))
			{
				endPoint.Y = tfArray[1].Y;
				return tfArray;
			}
			endPoint.Y = tfArray[2].Y;
			return tfArray;
		}

		internal static BarDrawingStyle GetBarDrawingStyle(DataPoint point)
		{
			BarDrawingStyle style = BarDrawingStyle.Default;
			string strA = point["DrawingStyle"];
			if (strA == null)
			{
				return style;
			}
			if (string.Compare(strA, "Default", StringComparison.OrdinalIgnoreCase) == 0)
			{
				return BarDrawingStyle.Default;
			}
			if (string.Compare(strA, "Cylinder", StringComparison.OrdinalIgnoreCase) == 0)
			{
				return BarDrawingStyle.Cylinder;
			}
			if (string.Compare(strA, "Emboss", StringComparison.OrdinalIgnoreCase) == 0)
			{
				return BarDrawingStyle.Emboss;
			}
			if (string.Compare(strA, "LightToDark", StringComparison.OrdinalIgnoreCase) == 0)
			{
				return BarDrawingStyle.LightToDark;
			}
			if (string.Compare(strA, "Wedge", StringComparison.OrdinalIgnoreCase) != 0)
			{
				throw new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(strA, "DrawingStyle"));
			}
			return BarDrawingStyle.Wedge;
		}

		internal Color GetBrightGradientColor(Color beginColor, double position)
		{
			double num = 0.5;
			if (position < num)
			{
				return GetGradientColor(Color.FromArgb(beginColor.A, 0xff, 0xff, 0xff), beginColor, (1.0 - num) + position);
			}
			if ((-num + position) < 1.0)
			{
				return GetGradientColor(beginColor, Color.Black, -num + position);
			}
			return Color.FromArgb(beginColor.A, 0, 0, 0);
		}

		internal Brush GetGradientBrush(RectangleF rectangle, Color firstColor, Color secondColor, GradientStyle type)
		{
			rectangle.Inflate(1f, 1f);
			Brush brush = null;
			float angle = 0f;
			if ((rectangle.Height == 0f) || (rectangle.Width == 0f))
			{
				return new SolidBrush(Color.Black);
			}
			if ((type == GradientStyle.LeftRight) || (type == GradientStyle.VerticalCenter))
			{
				angle = 0f;
			}
			else if ((type == GradientStyle.TopBottom) || (type == GradientStyle.HorizontalCenter))
			{
				angle = 90f;
			}
			else if (type == GradientStyle.DiagonalLeft)
			{
				angle = (float)((Math.Atan((double)(rectangle.Width / rectangle.Height)) * 180.0) / 3.1415926535897931);
			}
			else if (type == GradientStyle.DiagonalRight)
			{
				angle = (float)(180.0 - ((Math.Atan((double)(rectangle.Width / rectangle.Height)) * 180.0) / 3.1415926535897931));
			}
			if ((((type == GradientStyle.TopBottom) || (type == GradientStyle.LeftRight)) || ((type == GradientStyle.DiagonalLeft) || (type == GradientStyle.DiagonalRight))) || ((type == GradientStyle.HorizontalCenter) || (type == GradientStyle.VerticalCenter)))
			{
				RectangleF rect = new RectangleF(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
				if (type == GradientStyle.HorizontalCenter)
				{
					rect.Height /= 2f;
					LinearGradientBrush brush2 = new LinearGradientBrush(rect, firstColor, secondColor, angle);
					brush = brush2;
					brush2.WrapMode = WrapMode.TileFlipX;
					return brush;
				}
				if (type == GradientStyle.VerticalCenter)
				{
					rect.Width /= 2f;
					LinearGradientBrush brush3 = new LinearGradientBrush(rect, firstColor, secondColor, angle);
					brush = brush3;
					brush3.WrapMode = WrapMode.TileFlipX;
					return brush;
				}
				return new LinearGradientBrush(rectangle, firstColor, secondColor, angle);
			}
			GraphicsPath path = new GraphicsPath();
			path.AddRectangle(rectangle);
			PathGradientBrush brush4 = new PathGradientBrush(path);
			brush = brush4;
			brush4.CenterColor = firstColor;
			Color[] colorArray = new Color[] { secondColor };
			brush4.SurroundColors = colorArray;
			if (path != null)
			{
				path.Dispose();
			}
			return brush;
		}

		internal static Color GetGradientColor(Color beginColor, Color endColor, double relativePosition)
		{
			if (((relativePosition < 0.0) || (relativePosition > 1.0)) || double.IsNaN(relativePosition))
			{
				return beginColor;
			}
			int r = beginColor.R;
			int g = beginColor.G;
			int b = beginColor.B;
			int num4 = endColor.R;
			int num5 = endColor.G;
			int num6 = endColor.B;
			double num7 = r + ((num4 - r) * relativePosition);
			double num8 = g + ((num5 - g) * relativePosition);
			double num9 = b + ((num6 - b) * relativePosition);
			if (num7 > 255.0)
			{
				num7 = 255.0;
			}
			if (num7 < 0.0)
			{
				num7 = 0.0;
			}
			if (num8 > 255.0)
			{
				num8 = 255.0;
			}
			if (num8 < 0.0)
			{
				num8 = 0.0;
			}
			if (num9 > 255.0)
			{
				num9 = 255.0;
			}
			if (num9 < 0.0)
			{
				num9 = 0.0;
			}
			return Color.FromArgb(beginColor.A, (int)num7, (int)num8, (int)num9);
		}

		internal Brush GetHatchBrush(ChartHatchStyle hatchStyle, Color backColor, Color foreColor)
		{
			return new HatchBrush((HatchStyle)Enum.Parse(typeof(HatchStyle), hatchStyle.ToString()), foreColor, backColor);
		}

		internal static PointF GetLinesIntersection(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
		{
			PointF empty = PointF.Empty;
			if ((x1 == x2) && (y3 == y4))
			{
				empty.X = x1;
				empty.Y = y3;
				return empty;
			}
			if ((y1 == y2) && (x3 == x4))
			{
				empty.X = x3;
				empty.Y = y1;
				return empty;
			}
			if (x1 == x2)
			{
				empty.X = x1;
				empty.Y = (empty.X - x3) * (y4 - y3);
				empty.Y /= x4 - x3;
				empty.Y += y3;
				return empty;
			}
			if (x3 == x4)
			{
				empty.X = x3;
				empty.Y = (empty.X - x1) * (y2 - y1);
				empty.Y /= x2 - x1;
				empty.Y += y1;
				return empty;
			}
			float num = (y1 - y2) / (x1 - x2);
			float num2 = y1 - (num * x1);
			float num3 = (y3 - y4) / (x3 - x4);
			float num4 = y3 - (num3 * x3);
			empty.X = (num4 - num2) / (num - num3);
			empty.Y = (num * empty.X) + num2;
			return empty;
		}

		internal DashStyle GetPenStyle(ChartDashStyle style)
		{
			switch (style)
			{
				case ChartDashStyle.Dash:
					return DashStyle.Dash;

				case ChartDashStyle.DashDot:
					return DashStyle.DashDot;

				case ChartDashStyle.DashDotDot:
					return DashStyle.DashDotDot;

				case ChartDashStyle.Dot:
					return DashStyle.Dot;
			}
			return DashStyle.Solid;
		}

		internal static PieDrawingStyle GetPieDrawingStyle(DataPoint point)
		{
			PieDrawingStyle style = PieDrawingStyle.Default;
			string strA = point["PieDrawingStyle"];
			if (strA == null)
			{
				return style;
			}
			if (string.Compare(strA, "Default", StringComparison.OrdinalIgnoreCase) == 0)
			{
				return PieDrawingStyle.Default;
			}
			if (string.Compare(strA, "SoftEdge", StringComparison.OrdinalIgnoreCase) == 0)
			{
				return PieDrawingStyle.SoftEdge;
			}
			if (string.Compare(strA, "Concave", StringComparison.OrdinalIgnoreCase) != 0)
			{
				throw new InvalidOperationException(SR.ExceptionCustomAttributeValueInvalid(strA, "PieDrawingStyle"));
			}
			return PieDrawingStyle.Concave;
		}

		internal Brush GetPieGradientBrush(RectangleF rectangle, Color firstColor, Color secondColor)
		{
			GraphicsPath path = new GraphicsPath();
			path.AddEllipse(rectangle);
			PathGradientBrush brush = new PathGradientBrush(path);
			brush.CenterColor = firstColor;
			Color[] colorArray = new Color[] { secondColor };
			brush.SurroundColors = colorArray;
			if (path != null)
			{
				path.Dispose();
			}
			return brush;
		}

		internal GraphicsPath GetPolygonCirclePath(RectangleF position, int polygonSectorsNumber)
		{
			PointF tf = new PointF(position.X + (position.Width / 2f), position.Y);
			PointF point = new PointF(position.X + (position.Width / 2f), position.Y + (position.Height / 2f));
			float num = 0f;
			GraphicsPath path = new GraphicsPath();
			PointF empty = PointF.Empty;
			float angle = 0f;
			if (polygonSectorsNumber <= 2)
			{
				num = 1f;
			}
			else
			{
				num = 360f / ((float)polygonSectorsNumber);
			}
			for (angle = 0f; angle < 360f; angle += num)
			{
				Matrix matrix = new Matrix();
				matrix.RotateAt(angle, point);
				PointF[] pts = new PointF[] { tf };
				matrix.TransformPoints(pts);
				if (!empty.IsEmpty)
				{
					path.AddLine(empty, pts[0]);
				}
				empty = pts[0];
			}
			path.CloseAllFigures();
			return path;
		}

		public double GetPositionFromAxis(string chartAreaName, AxisName axis, double axisValue)
		{
			if (axis == AxisName.X)
			{
				return this._common.ChartPicture.ChartAreas[chartAreaName].AxisX.GetLinearPosition(axisValue);
			}
			if (axis == AxisName.X2)
			{
				return this._common.ChartPicture.ChartAreas[chartAreaName].AxisX2.GetLinearPosition(axisValue);
			}
			if (axis == AxisName.Y)
			{
				return this._common.ChartPicture.ChartAreas[chartAreaName].AxisY.GetLinearPosition(axisValue);
			}
			if (axis == AxisName.Y2)
			{
				return this._common.ChartPicture.ChartAreas[chartAreaName].AxisY2.GetLinearPosition(axisValue);
			}
			return 0.0;
		}

		public PointF GetRelativePoint(PointF point)
		{
			PointF empty = PointF.Empty;
			empty.X = (point.X * 100f) / ((float)(this._width - 1));
			empty.Y = (point.Y * 100f) / ((float)(this._height - 1));
			return empty;
		}

		public RectangleF GetRelativeRectangle(RectangleF rectangle)
		{
			RectangleF empty = RectangleF.Empty;
			empty.X = (rectangle.X * 100f) / ((float)(this._width - 1));
			empty.Y = (rectangle.Y * 100f) / ((float)(this._height - 1));
			empty.Width = (rectangle.Width * 100f) / ((float)(this._width - 1));
			empty.Height = (rectangle.Height * 100f) / ((float)(this._height - 1));
			return empty;
		}

		public SizeF GetRelativeSize(SizeF size)
		{
			SizeF empty = SizeF.Empty;
			empty.Width = (size.Width * 100f) / ((float)(this._width - 1));
			empty.Height = (size.Height * 100f) / ((float)(this._height - 1));
			return empty;
		}

		internal Brush GetSector3DBrush(Brush brush, float curentSector, float sectorSize)
		{
			Color gray = Color.Gray;
			if (brush is HatchBrush)
			{
				gray = ((HatchBrush)brush).BackgroundColor;
			}
			else if (brush is LinearGradientBrush)
			{
				gray = ((LinearGradientBrush)brush).LinearColors[0];
			}
			else if (brush is PathGradientBrush)
			{
				gray = ((PathGradientBrush)brush).CenterColor;
			}
			else if (brush is SolidBrush)
			{
				gray = ((SolidBrush)brush).Color;
			}
			curentSector -= sectorSize / 2f;
			if ((sectorSize == 72f) && (curentSector == 180f))
			{
				curentSector *= 0.8f;
			}
			if (curentSector > 180f)
			{
				curentSector = 360f - curentSector;
			}
			curentSector /= 180f;
			return new SolidBrush(this.GetBrightGradientColor(gray, (double)curentSector));
		}

		internal GraphicsPath GetSplineFlattenPath(ChartArea area, float positionZ, DataPoint3D firstPoint, DataPoint3D secondPoint, ArrayList points, float tension, bool flatten, bool translateCoordinates, int yValueIndex)
		{
			int index = (firstPoint.index < secondPoint.index) ? firstPoint.index : secondPoint.index;
			index--;
			if (index >= (points.Count - 2))
			{
				index--;
			}
			if (index < 1)
			{
				index = 1;
			}
			int neighborPointIndex = -2147483648;
			DataPoint3D[] pointdArray = new DataPoint3D[] { FindPointByIndex(points, index, null, ref neighborPointIndex), FindPointByIndex(points, index + 1, null, ref neighborPointIndex), FindPointByIndex(points, index + 2, null, ref neighborPointIndex), FindPointByIndex(points, index + 3, null, ref neighborPointIndex) };
			int num3 = 0;
			while (num3 < 4)
			{
				if ((pointdArray[num3].index == firstPoint.index) || (pointdArray[num3].index == secondPoint.index))
				{
					break;
				}
				num3++;
			}
			int num4 = 2;
			if (pointdArray[2] != null)
			{
				num4++;
			}
			if (pointdArray[3] != null)
			{
				num4++;
			}
			PointF[] tfArray = new PointF[num4];
			if (yValueIndex == 0)
			{
				tfArray[0] = new PointF((float)pointdArray[0].xPosition, (float)pointdArray[0].yPosition);
				tfArray[1] = new PointF((float)pointdArray[1].xPosition, (float)pointdArray[1].yPosition);
				if (num4 > 2)
				{
					tfArray[2] = new PointF((float)pointdArray[2].xPosition, (float)pointdArray[2].yPosition);
				}
				if (num4 > 3)
				{
					tfArray[3] = new PointF((float)pointdArray[3].xPosition, (float)pointdArray[3].yPosition);
				}
			}
			else
			{
				Axis axis = (firstPoint.dataPoint.series.YAxisType == AxisType.Primary) ? area.AxisY : area.AxisY2;
				float position = (float)axis.GetPosition(pointdArray[0].dataPoint.YValues[yValueIndex]);
				tfArray[0] = new PointF((float)pointdArray[0].xPosition, position);
				position = (float)axis.GetPosition(pointdArray[1].dataPoint.YValues[yValueIndex]);
				tfArray[1] = new PointF((float)pointdArray[1].xPosition, position);
				if (num4 > 2)
				{
					position = (float)axis.GetPosition(pointdArray[2].dataPoint.YValues[yValueIndex]);
					tfArray[2] = new PointF((float)pointdArray[2].xPosition, position);
				}
				if (num4 > 3)
				{
					position = (float)axis.GetPosition(pointdArray[3].dataPoint.YValues[yValueIndex]);
					tfArray[3] = new PointF((float)pointdArray[3].xPosition, position);
				}
			}
			if (translateCoordinates)
			{
				Point3D[] pointdArray2 = new Point3D[num4];
				for (int i = 0; i < num4; i++)
				{
					pointdArray2[i] = new Point3D(tfArray[i].X, tfArray[i].Y, positionZ);
				}
				area.matrix3D.TransformPoints(pointdArray2);
				for (int j = 0; j < num4; j++)
				{
					tfArray[j] = this.GetAbsolutePoint(pointdArray2[j].PointF);
				}
			}
			GraphicsPath path = new GraphicsPath();
			path.AddCurve(tfArray, num3, 1, tension);
			if (flatten)
			{
				path.Flatten();
			}
			if (firstPoint.index > secondPoint.index)
			{
				path.Reverse();
			}
			return path;
		}

		internal static string GetStackedText(string text)
		{
			string str = string.Empty;
			foreach (char ch in text)
			{
				str = str + ch;
				if (ch != '\n')
				{
					str = str + '\n';
				}
			}
			return str;
		}

		internal Brush GetTextureBrush(string name, Color backImageTransparentColor, ChartImageWrapMode mode, Color backColor)
		{
			Image image = this._common.ImageLoader.LoadImage(name);
			ImageAttributes imageAttr = new ImageAttributes();
			imageAttr.SetWrapMode((mode == ChartImageWrapMode.Unscaled) ? WrapMode.Clamp : ((WrapMode)mode));
			if (backImageTransparentColor != Color.Empty)
			{
				imageAttr.SetColorKey(backImageTransparentColor, backImageTransparentColor, ColorAdjustType.Default);
			}
			if (((backImageTransparentColor == Color.Empty) && (image is Metafile)) && (backColor != Color.Transparent))
			{
				TextureBrush brush = null;
				Bitmap bitmap = new Bitmap(image.Width, image.Height);
				using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap))
				{
					using (SolidBrush brush2 = new SolidBrush(backColor))
					{
						graphics.FillRectangle(brush2, 0, 0, image.Width, image.Height);
						graphics.DrawImageUnscaled(image, 0, 0);
						brush = new TextureBrush(bitmap, new RectangleF(0f, 0f, (float)image.Width, (float)image.Height), imageAttr);
					}
				}
				return brush;
			}
			if (ImageLoader.DoDpisMatch(image, this.Graphics))
			{
				return new TextureBrush(image, new RectangleF(0f, 0f, (float)image.Width, (float)image.Height), imageAttr);
			}
			Image scaledImage = ImageLoader.GetScaledImage(image, this.Graphics);
			TextureBrush brush3 = new TextureBrush(scaledImage, new RectangleF(0f, 0f, (float)scaledImage.Width, (float)scaledImage.Height), imageAttr);
			scaledImage.Dispose();
			return brush3;
		}

		internal GraphicsPath GetTranformedTextRectPath(PointF center, SizeF size, int angle)
		{
			size.Width += 10f;
			size.Height += 10f;
			PointF absolutePoint = this.GetAbsolutePoint(center);
			PointF[] pts = new PointF[] { new PointF(absolutePoint.X - (size.Width / 2f), absolutePoint.Y - (size.Height / 2f)), new PointF(absolutePoint.X + (size.Width / 2f), absolutePoint.Y - (size.Height / 2f)), new PointF(absolutePoint.X + (size.Width / 2f), absolutePoint.Y + (size.Height / 2f)), new PointF(absolutePoint.X - (size.Width / 2f), absolutePoint.Y + (size.Height / 2f)) };
			Matrix matrix = this.Transform.Clone();
			matrix.RotateAt((float)angle, absolutePoint);
			matrix.TransformPoints(pts);
			GraphicsPath path = new GraphicsPath();
			path.AddLines(pts);
			path.CloseAllFigures();
			return path;
		}

		internal SurfaceNames GetVisibleSurfaces(RectangleF position, float positionZ, float depth, Matrix3D matrix)
		{
			if (matrix.Perspective != 0f)
			{
				return this.GetVisibleSurfacesWithPerspective(position, positionZ, depth, matrix);
			}
			SurfaceNames front = SurfaceNames.Front;
			if (matrix.AngleY > 0f)
			{
				front |= SurfaceNames.Right;
			}
			else if (matrix.AngleY < 0f)
			{
				front |= SurfaceNames.Left;
			}
			if (matrix.AngleX > 0f)
			{
				return (front | SurfaceNames.Top);
			}
			if (matrix.AngleX < 0f)
			{
				front |= SurfaceNames.Bottom;
			}
			return front;
		}

		internal SurfaceNames GetVisibleSurfacesWithPerspective(Point3D[] cubePoints)
		{
			if (cubePoints.Length != 8)
			{
				throw new ArgumentException(SR.ExceptionGraphics3DCoordinatesInvalid, "cubePoints");
			}
			SurfaceNames names = 0;
			if (IsSurfaceVisible(cubePoints[0], cubePoints[3], cubePoints[2]))
			{
				names |= SurfaceNames.Front;
			}
			if (IsSurfaceVisible(cubePoints[4], cubePoints[5], cubePoints[6]))
			{
				names |= SurfaceNames.Back;
			}
			if (IsSurfaceVisible(cubePoints[0], cubePoints[1], cubePoints[5]))
			{
				names |= SurfaceNames.Left;
			}
			if (IsSurfaceVisible(cubePoints[3], cubePoints[7], cubePoints[6]))
			{
				names |= SurfaceNames.Right;
			}
			if (IsSurfaceVisible(cubePoints[4], cubePoints[7], cubePoints[3]))
			{
				names |= SurfaceNames.Top;
			}
			if (IsSurfaceVisible(cubePoints[1], cubePoints[2], cubePoints[6]))
			{
				names |= SurfaceNames.Bottom;
			}
			return names;
		}

		internal SurfaceNames GetVisibleSurfacesWithPerspective(RectangleF position, float positionZ, float depth, Matrix3D matrix)
		{
			Point3D[] points = new Point3D[] { new Point3D(position.X, position.Y, positionZ + depth), new Point3D(position.X, position.Bottom, positionZ + depth), new Point3D(position.Right, position.Bottom, positionZ + depth), new Point3D(position.Right, position.Y, positionZ + depth), new Point3D(position.X, position.Y, positionZ), new Point3D(position.X, position.Bottom, positionZ), new Point3D(position.Right, position.Bottom, positionZ), new Point3D(position.Right, position.Y, positionZ) };
			matrix.TransformPoints(points);
			return this.GetVisibleSurfacesWithPerspective(points);
		}

		internal static bool IsSurfaceVisible(Point3D first, Point3D second, Point3D tree)
		{
			float num = (first.Y - second.Y) / (first.X - second.X);
			float num2 = first.Y - (num * first.X);
			if (first.X == second.X)
			{
				if (first.Y > second.Y)
				{
					return (tree.X > first.X);
				}
				if (tree.X > first.X)
				{
					return false;
				}
				return true;
			}
			if (first.X < second.X)
			{
				if (tree.Y < ((num * tree.X) + num2))
				{
					return false;
				}
				return true;
			}
			return (tree.Y <= ((num * tree.X) + num2));
		}

		internal SizeF MeasureString(string text, Font font)
		{
			return this.RenderingObject.MeasureString(text, font);
		}

		internal SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
		{
			return this.RenderingObject.MeasureString(text, font, layoutArea, stringFormat);
		}

		internal SizeF MeasureString(string text, Font font, SizeF layoutArea, StringFormat stringFormat, TextOrientation textOrientation)
		{
			if (textOrientation == TextOrientation.Stacked)
			{
				text = GetStackedText(text);
			}
			return this.MeasureString(text, font, layoutArea, stringFormat);
		}

		internal Size MeasureStringAbs(string text, Font font)
		{
			SizeF ef = this.MeasureString(text, font);
			return new Size((int)Math.Ceiling((double)ef.Width), (int)Math.Ceiling((double)ef.Height));
		}

		internal Size MeasureStringAbs(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
		{
			SizeF ef = this.MeasureString(text, font, layoutArea, stringFormat);
			return new Size((int)Math.Ceiling((double)ef.Width), (int)Math.Ceiling((double)ef.Height));
		}

		internal SizeF MeasureStringRel(string text, Font font)
		{
			SizeF size = this.MeasureString(text, font);
			return this.GetRelativeSize(size);
		}

		internal SizeF MeasureStringRel(string text, Font font, SizeF layoutArea, StringFormat stringFormat)
		{
			SizeF absoluteSize = this.GetAbsoluteSize(layoutArea);
			SizeF size = this.MeasureString(text, font, absoluteSize, stringFormat);
			return this.GetRelativeSize(size);
		}

		internal SizeF MeasureStringRel(string text, Font font, SizeF layoutArea, StringFormat stringFormat, TextOrientation textOrientation)
		{
			if (textOrientation == TextOrientation.Stacked)
			{
				text = GetStackedText(text);
			}
			return this.MeasureStringRel(text, font, layoutArea, stringFormat);
		}

		internal void ResetClip()
		{
			this.RenderingObject.ResetClip();
		}

		internal void Restore(GraphicsState gstate)
		{
			this.RenderingObject.Restore(gstate);
		}

		internal RectangleF Round(RectangleF rect)
		{
			float x = (float)Math.Round((double)rect.Left);
			float num2 = (float)Math.Round((double)rect.Right);
			float y = (float)Math.Round((double)rect.Top);
			float num4 = (float)Math.Round((double)rect.Bottom);
			return new RectangleF(x, y, num2 - x, num4 - y);
		}

		internal GraphicsState Save()
		{
			return this.RenderingObject.Save();
		}

		internal void SetClip(RectangleF region)
		{
			this.SetClipAbs(this.GetAbsoluteRectangle(region));
		}

		internal void SetClipAbs(RectangleF rect)
		{
			this.RenderingObject.SetClip(rect);
		}

		internal void SetPictureSize(int width, int height)
		{
			this._width = width;
			this._height = height;
		}

		internal static int ShouldDrawLineChartSurface(ChartArea area, bool reversedSeriesOrder, SurfaceNames surfaceName, SurfaceNames boundaryRectVisibleSurfaces, Color color, ArrayList points, DataPoint3D firstPoint, DataPoint3D secondPoint, bool multiSeries, ref LineSegmentType lineSegmentType)
		{
			int num = 0;
			Axis axis = (firstPoint.dataPoint.series.XAxisType == AxisType.Primary) ? area.AxisX : area.AxisX2;
			double viewMinimum = axis.ViewMinimum;
			double viewMaximum = axis.ViewMaximum;
			bool flag = color.A != 0xff;
			bool flag2 = false;
			bool flag3 = false;
			if (surfaceName == SurfaceNames.Left)
			{
				DataPoint3D pointd = null;
				DataPoint3D pointd2 = null;
				int neighborPointIndex = -2147483648;
				if (!reversedSeriesOrder)
				{
					pointd = FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index) - 1, multiSeries ? secondPoint : null, ref neighborPointIndex);
					pointd2 = FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index), multiSeries ? secondPoint : null, ref neighborPointIndex);
				}
				else
				{
					pointd = FindPointByIndex(points, Math.Max(firstPoint.index, secondPoint.index) + 1, multiSeries ? secondPoint : null, ref neighborPointIndex);
					pointd2 = pointd;
				}
				if (pointd != null)
				{
					if (pointd2.dataPoint.IsEmpty)
					{
						if ((pointd2.dataPoint.series.EmptyPointStyle.Color == color) || (pointd2.dataPoint.series.EmptyPointStyle.Color.A == 0xff))
						{
							flag2 = true;
						}
					}
					else if ((pointd2.dataPoint.Color == color) || (pointd2.dataPoint.Color.A == 0xff))
					{
						flag2 = true;
					}
					double num5 = pointd.indexedSeries ? ((double)pointd.index) : pointd.dataPoint.XValue;
					if ((num5 > viewMaximum) || (num5 < viewMinimum))
					{
						DataPoint3D pointd3 = null;
						if (reversedSeriesOrder)
						{
							pointd3 = (firstPoint.index > secondPoint.index) ? firstPoint : secondPoint;
						}
						else
						{
							pointd3 = (firstPoint.index < secondPoint.index) ? firstPoint : secondPoint;
						}
						double num6 = pointd3.indexedSeries ? ((double)pointd3.index) : pointd3.dataPoint.XValue;
						if ((num6 > viewMaximum) || (num6 < viewMinimum))
						{
							flag2 = false;
						}
					}
				}
			}
			if (surfaceName == SurfaceNames.Right)
			{
				DataPoint3D pointd4 = null;
				DataPoint3D pointd5 = null;
				int num7 = -2147483648;
				if (!reversedSeriesOrder)
				{
					pointd4 = FindPointByIndex(points, Math.Max(firstPoint.index, secondPoint.index) + 1, multiSeries ? secondPoint : null, ref num7);
					pointd5 = pointd4;
				}
				else
				{
					pointd4 = FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index) - 1, multiSeries ? secondPoint : null, ref num7);
					pointd5 = FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index), multiSeries ? secondPoint : null, ref num7);
				}
				if (pointd4 != null)
				{
					if (pointd5.dataPoint.IsEmpty)
					{
						if ((pointd5.dataPoint.series.EmptyPointStyle.Color == color) || (pointd5.dataPoint.series.EmptyPointStyle.Color.A == 0xff))
						{
							flag3 = true;
						}
					}
					else if ((pointd5.dataPoint.Color == color) || (pointd5.dataPoint.Color.A == 0xff))
					{
						flag3 = true;
					}
					double num8 = pointd4.indexedSeries ? ((double)pointd4.index) : pointd4.dataPoint.XValue;
					if ((num8 > viewMaximum) || (num8 < viewMinimum))
					{
						DataPoint3D pointd6 = null;
						if (reversedSeriesOrder)
						{
							pointd6 = (firstPoint.index > secondPoint.index) ? firstPoint : secondPoint;
						}
						else
						{
							pointd6 = (firstPoint.index < secondPoint.index) ? firstPoint : secondPoint;
						}
						double num9 = pointd6.indexedSeries ? ((double)pointd6.index) : pointd6.dataPoint.XValue;
						if ((num9 > viewMaximum) || (num9 < viewMinimum))
						{
							flag3 = false;
						}
					}
				}
			}
			if ((surfaceName == SurfaceNames.Left) && !flag2)
			{
				if (lineSegmentType == LineSegmentType.Middle)
				{
					lineSegmentType = LineSegmentType.First;
				}
				else if (lineSegmentType == LineSegmentType.Last)
				{
					lineSegmentType = LineSegmentType.Single;
				}
			}
			if ((surfaceName == SurfaceNames.Right) && !flag3)
			{
				if (lineSegmentType == LineSegmentType.Middle)
				{
					lineSegmentType = LineSegmentType.Last;
				}
				else if (lineSegmentType == LineSegmentType.First)
				{
					lineSegmentType = LineSegmentType.Single;
				}
			}
			if (surfaceName == SurfaceNames.Top)
			{
				num = ((boundaryRectVisibleSurfaces & SurfaceNames.Top) == SurfaceNames.Top) ? 2 : 1;
			}
			if (surfaceName == SurfaceNames.Bottom)
			{
				num = ((boundaryRectVisibleSurfaces & SurfaceNames.Bottom) == SurfaceNames.Bottom) ? 2 : 1;
				if ((num == 1) && !flag)
				{
					num = 0;
				}
			}
			if (surfaceName == SurfaceNames.Front)
			{
				num = ((boundaryRectVisibleSurfaces & SurfaceNames.Front) == SurfaceNames.Front) ? 2 : 1;
				if ((num == 1) && !flag)
				{
					num = 0;
				}
			}
			if (surfaceName == SurfaceNames.Back)
			{
				num = ((boundaryRectVisibleSurfaces & SurfaceNames.Back) == SurfaceNames.Back) ? 2 : 1;
				if ((num == 1) && !flag)
				{
					num = 0;
				}
			}
			if (surfaceName == SurfaceNames.Left)
			{
				num = ((boundaryRectVisibleSurfaces & SurfaceNames.Left) == SurfaceNames.Left) ? 2 : 1;
				if (flag2)
				{
					num = 0;
				}
			}
			if (surfaceName == SurfaceNames.Right)
			{
				num = ((boundaryRectVisibleSurfaces & SurfaceNames.Right) == SurfaceNames.Right) ? 2 : 1;
				if (flag3)
				{
					num = 0;
				}
			}
			return num;
		}

		internal void StartHotRegion(DataPoint point)
		{
			this.StartHotRegion(point, false);
		}

		internal void StartHotRegion(string url, string title)
		{
			this.RenderingObject.BeginSelection(url, title);
		}

		internal void StartHotRegion(DataPoint point, bool labelRegion)
		{
			string strOriginal = string.Empty;
			string str2 = labelRegion ? point.LabelToolTip : point.ToolTip;
			strOriginal = labelRegion ? point.LabelUrl : point.Url;
			if ((strOriginal.Length > 0) || (str2.Length > 0))
			{
				this.RenderingObject.BeginSelection(point.ReplaceKeywords(strOriginal), point.ReplaceKeywords(str2));
			}
		}

		internal void TranslateTransform(float dx, float dy)
		{
			this.RenderingObject.TranslateTransform(dx, dy);
		}

		internal RenderingType ActiveRenderingType
		{
			get
			{
				return this._activeRenderingType;
			}
		}

		internal AntiAliasingStyles AntiAliasing
		{
			get
			{
				return this._antiAliasing;
			}
			set
			{
				this._antiAliasing = value;
				if (this.Graphics != null)
				{
					if ((this._antiAliasing & AntiAliasingStyles.Graphics) == AntiAliasingStyles.Graphics)
					{
						this.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
					}
					else
					{
						this.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
					}
				}
			}
		}

		internal Region Clip
		{
			get
			{
				return this.RenderingObject.Clip;
			}
			set
			{
				this.RenderingObject.Clip = value;
			}
		}

		public System.Drawing.Graphics Graphics
		{
			get
			{
				return this.RenderingObject.Graphics;
			}
			set
			{
				this.RenderingObject.Graphics = value;
			}
		}

		internal bool IsClipEmpty
		{
			get
			{
				return this.RenderingObject.IsClipEmpty;
			}
		}

		internal System.Drawing.Pen Pen
		{
			get
			{
				return this._pen;
			}
		}

		internal IChartRenderingEngine RenderingObject
		{
			get
			{
				return this._gdiGraphics;
			}
		}

		internal System.Drawing.Drawing2D.SmoothingMode SmoothingMode
		{
			get
			{
				return this.RenderingObject.SmoothingMode;
			}
			set
			{
				this.RenderingObject.SmoothingMode = value;
			}
		}

		internal System.Drawing.Text.TextRenderingHint TextRenderingHint
		{
			get
			{
				return this.RenderingObject.TextRenderingHint;
			}
			set
			{
				this.RenderingObject.TextRenderingHint = value;
			}
		}

		internal Matrix Transform
		{
			get
			{
				return this.RenderingObject.Transform;
			}
			set
			{
				this.RenderingObject.Transform = value;
			}
		}
	}
}

